# Method API Docs

## Docs

- [October Updates](https://docs.methodfi.com/changelog/2024/october)
- [September Updates](https://docs.methodfi.com/changelog/2024/september)
- [Introducing API v2](https://docs.methodfi.com/changelog/api-versions/2024-04-04)
- [Create a Connect Element Token](https://docs.methodfi.com/elements/connect/create_connect_token)
- [Getting Connect Results](https://docs.methodfi.com/elements/connect/get_results)
- [Launching a Connect Session](https://docs.methodfi.com/elements/connect/launch_connect)
- [Connect Overview](https://docs.methodfi.com/elements/connect/overview)
- [Environments](https://docs.methodfi.com/elements/environments)
- [General Events](https://docs.methodfi.com/elements/events/general_events)
- [Events Overview](https://docs.methodfi.com/elements/events/overview)
- [Element Specific Events](https://docs.methodfi.com/elements/events/specific_events)
- [Element SDKs](https://docs.methodfi.com/elements/libraries)
- [Overview](https://docs.methodfi.com/elements/overview)
- [Overview](https://docs.methodfi.com/libraries/overview)
- [Create a Balance](https://docs.methodfi.com/reference/accounts/balances/create)
- [List all Balances](https://docs.methodfi.com/reference/accounts/balances/list)
- [The balances endpoint](https://docs.methodfi.com/reference/accounts/balances/overview)
- [Retrieve a Balance](https://docs.methodfi.com/reference/accounts/balances/retrieve)
- [Create a Card Brand](https://docs.methodfi.com/reference/accounts/card-brands/create)
- [List all Card Brands](https://docs.methodfi.com/reference/accounts/card-brands/list)
- [The card brand endpoint](https://docs.methodfi.com/reference/accounts/card-brands/overview)
- [Retrieve a Card Brand](https://docs.methodfi.com/reference/accounts/card-brands/retrieve)
- [Withdraw an Account's Consent](https://docs.methodfi.com/reference/accounts/consent/withdraw)
- [Create an Account](https://docs.methodfi.com/reference/accounts/create)
- [List all Accounts](https://docs.methodfi.com/reference/accounts/list)
- [The account endpoint](https://docs.methodfi.com/reference/accounts/overview)
- [Create a Payoff](https://docs.methodfi.com/reference/accounts/payoffs/create)
- [List all Payoffs](https://docs.methodfi.com/reference/accounts/payoffs/list)
- [The payoffs endpoint](https://docs.methodfi.com/reference/accounts/payoffs/overview)
- [Retrieve a Payoff](https://docs.methodfi.com/reference/accounts/payoffs/retrieve)
- [List all Products](https://docs.methodfi.com/reference/accounts/products/list)
- [The products endpoint](https://docs.methodfi.com/reference/accounts/products/overview)
- [Retrieve a Product](https://docs.methodfi.com/reference/accounts/products/retrieve)
- [Retrieve an Account](https://docs.methodfi.com/reference/accounts/retrieve)
- [Create a Sensitive](https://docs.methodfi.com/reference/accounts/sensitive/create)
- [The sensitive endpoint](https://docs.methodfi.com/reference/accounts/sensitive/overview)
- [Retrieve a Sensitive](https://docs.methodfi.com/reference/accounts/sensitive/retrieve)
- [Create a Subscription](https://docs.methodfi.com/reference/accounts/subscriptions/create)
- [Delete a Subscription](https://docs.methodfi.com/reference/accounts/subscriptions/delete)
- [List all Subscriptions](https://docs.methodfi.com/reference/accounts/subscriptions/list)
- [The subscriptions endpoint](https://docs.methodfi.com/reference/accounts/subscriptions/overview)
- [Retrieve a Subscription](https://docs.methodfi.com/reference/accounts/subscriptions/retrieve)
- [List all Transactions](https://docs.methodfi.com/reference/accounts/transactions/list)
- [The transactions endpoint](https://docs.methodfi.com/reference/accounts/transactions/overview)
- [Retrieve a Transaction](https://docs.methodfi.com/reference/accounts/transactions/retrieve)
- [Create an Update](https://docs.methodfi.com/reference/accounts/updates/create)
- [List all Updates](https://docs.methodfi.com/reference/accounts/updates/list)
- [The updates endpoint](https://docs.methodfi.com/reference/accounts/updates/overview)
- [Retrieve an Update](https://docs.methodfi.com/reference/accounts/updates/retrieve)
- [Create a Verification](https://docs.methodfi.com/reference/accounts/verification-sessions/create)
- [The account verification sessions endpoint](https://docs.methodfi.com/reference/accounts/verification-sessions/overview)
- [Retrieve a Verification](https://docs.methodfi.com/reference/accounts/verification-sessions/retrieve)
- [Update a Micro-deposits Verification](https://docs.methodfi.com/reference/accounts/verification-sessions/update-microdeposits)
- [Update an MX Verification](https://docs.methodfi.com/reference/accounts/verification-sessions/update-mx)
- [Update a Plaid Verification](https://docs.methodfi.com/reference/accounts/verification-sessions/update-plaid)
- [Update a Pre-auth Verification](https://docs.methodfi.com/reference/accounts/verification-sessions/update-preauth)
- [Update a Standard Verification](https://docs.methodfi.com/reference/accounts/verification-sessions/update-standard)
- [Update a Teller Verification](https://docs.methodfi.com/reference/accounts/verification-sessions/update-teller)
- [Authentication](https://docs.methodfi.com/reference/authentication)
- [The element endpoint](https://docs.methodfi.com/reference/elements/overview)
- [Retrieve Element Results](https://docs.methodfi.com/reference/elements/results)
- [Create Session](https://docs.methodfi.com/reference/elements/sessions/create-session): `POST /elements/token`
- [Get Session](https://docs.methodfi.com/reference/elements/sessions/get-session): `GET /elements/sessions/:session_id`
- [The sessions endpoint](https://docs.methodfi.com/reference/elements/sessions/overview)
- [Update Session](https://docs.methodfi.com/reference/elements/sessions/update-session): `PUT /elements/sessions/:session_id`
- [Create an Element Token](https://docs.methodfi.com/reference/elements/tokens)
- [Create Attributes](https://docs.methodfi.com/reference/entities/attributes/create)
- [The attributes endpoint](https://docs.methodfi.com/reference/entities/attributes/overview)
- [Retrieve Attributes](https://docs.methodfi.com/reference/entities/attributes/retrieve)
- [Create a Connect](https://docs.methodfi.com/reference/entities/connect/create)
- [The connect endpoint](https://docs.methodfi.com/reference/entities/connect/overview)
- [Retrieve a Connect](https://docs.methodfi.com/reference/entities/connect/retrieve)
- [Withdraw an Entity's Consent](https://docs.methodfi.com/reference/entities/consent/withdraw)
- [Create a Corporation](https://docs.methodfi.com/reference/entities/create-corporation)
- [Create an Individual](https://docs.methodfi.com/reference/entities/create-individual)
- [Create Individual Credit Scores](https://docs.methodfi.com/reference/entities/credit-scores/create)
- [The credit score endpoint](https://docs.methodfi.com/reference/entities/credit-scores/overview)
- [Retrieve Individual Credit Scores](https://docs.methodfi.com/reference/entities/credit-scores/retrieve)
- [Create Identities](https://docs.methodfi.com/reference/entities/identities/create)
- [The identities endpoint](https://docs.methodfi.com/reference/entities/identities/overview)
- [Retrieve Identities](https://docs.methodfi.com/reference/entities/identities/retrieve)
- [List all Entities](https://docs.methodfi.com/reference/entities/list-entities)
- [The entity endpoint](https://docs.methodfi.com/reference/entities/overview)
- [List all Products](https://docs.methodfi.com/reference/entities/products/list)
- [The products endpoint](https://docs.methodfi.com/reference/entities/products/overview)
- [Retrieve a Product](https://docs.methodfi.com/reference/entities/products/retrieve)
- [Retrieve an Entity](https://docs.methodfi.com/reference/entities/retrieve-entity)
- [Create a Subscription](https://docs.methodfi.com/reference/entities/subscriptions/create)
- [Delete a Subscription](https://docs.methodfi.com/reference/entities/subscriptions/delete)
- [List all Subscriptions](https://docs.methodfi.com/reference/entities/subscriptions/list)
- [The subscriptions endpoint](https://docs.methodfi.com/reference/entities/subscriptions/overview)
- [Retrieve a Subscription](https://docs.methodfi.com/reference/entities/subscriptions/retrieve)
- [Update an Entity](https://docs.methodfi.com/reference/entities/update-entity)
- [Create a BYO KYC Verification](https://docs.methodfi.com/reference/entities/verification-sessions/create-byo-kyc)
- [Create a BYO SMS Verification](https://docs.methodfi.com/reference/entities/verification-sessions/create-byo-sms)
- [Create a KBA Verification](https://docs.methodfi.com/reference/entities/verification-sessions/create-kba)
- [Create an SMS Verification](https://docs.methodfi.com/reference/entities/verification-sessions/create-sms)
- [Create an SNA Verification](https://docs.methodfi.com/reference/entities/verification-sessions/create-sna)
- [The entity verification sessions endpoint](https://docs.methodfi.com/reference/entities/verification-sessions/overview)
- [Retrieve a Verification Session](https://docs.methodfi.com/reference/entities/verification-sessions/retrieve)
- [Update a KBA Verification](https://docs.methodfi.com/reference/entities/verification-sessions/update-kba)
- [Update an SMS Verification](https://docs.methodfi.com/reference/entities/verification-sessions/update-sms)
- [Update an SNA Verification](https://docs.methodfi.com/reference/entities/verification-sessions/update-sna)
- [Environments](https://docs.methodfi.com/reference/environments)
- [Account Errors](https://docs.methodfi.com/reference/errors/account-errors)
- [Account Verification Session Errors](https://docs.methodfi.com/reference/errors/account-verification-session-errors)
- [Balance Errors](https://docs.methodfi.com/reference/errors/balance-errors)
- [Card Brand Errors](https://docs.methodfi.com/reference/errors/card-brand-errors)
- [Connect Errors](https://docs.methodfi.com/reference/errors/connect-errors)
- [Credit Score Errors](https://docs.methodfi.com/reference/errors/credit-score-errors)
- [Entity Errors](https://docs.methodfi.com/reference/errors/entity-errors)
- [Entity Verification Session Errors](https://docs.methodfi.com/reference/errors/entity-verification-session-errors)
- [Identity Errors](https://docs.methodfi.com/reference/errors/identity-errors)
- [Payment Errors](https://docs.methodfi.com/reference/errors/payment-errors)
- [Payment Reversal Errors](https://docs.methodfi.com/reference/errors/payment-reversal-errors)
- [Payoff Errors](https://docs.methodfi.com/reference/errors/payoff-errors)
- [Product Errors](https://docs.methodfi.com/reference/errors/product-errors)
- [Request Errors](https://docs.methodfi.com/reference/errors/request-errors)
- [Resource Errors](https://docs.methodfi.com/reference/errors/resource-errors)
- [Sensitive Errors](https://docs.methodfi.com/reference/errors/sensitive-errors)
- [Subscription Errors](https://docs.methodfi.com/reference/errors/subscription-errors)
- [Update Errors](https://docs.methodfi.com/reference/errors/update-errors)
- [Webhook Errors](https://docs.methodfi.com/reference/errors/webhook-errors)
- [List all Events](https://docs.methodfi.com/reference/events/list)
- [The event endpoint](https://docs.methodfi.com/reference/events/overview)
- [Retrieve an Event](https://docs.methodfi.com/reference/events/retrieve)
- [Expanding Resources](https://docs.methodfi.com/reference/expanding)
- [Perform a Health Check](https://docs.methodfi.com/reference/health-check)
- [Idempotency](https://docs.methodfi.com/reference/idempotency)
- [Introduction](https://docs.methodfi.com/reference/introduction)
- [IP Whitelisting](https://docs.methodfi.com/reference/ip-whitelisting)
- [List all Merchants](https://docs.methodfi.com/reference/merchants/list)
- [The merchant endpoint](https://docs.methodfi.com/reference/merchants/overview)
- [Retrieve a Merchant](https://docs.methodfi.com/reference/merchants/retrieve)
- [Metadata](https://docs.methodfi.com/reference/metadata)
- [Pagination](https://docs.methodfi.com/reference/pagination)
- [Create a Payment](https://docs.methodfi.com/reference/payments/create)
- [Delete a Payment](https://docs.methodfi.com/reference/payments/delete)
- [List all Payments](https://docs.methodfi.com/reference/payments/list)
- [The payment endpoint](https://docs.methodfi.com/reference/payments/overview)
- [Retrieve a Payment](https://docs.methodfi.com/reference/payments/retrieve)
- [Create a Report](https://docs.methodfi.com/reference/reports/create)
- [Download a Report](https://docs.methodfi.com/reference/reports/download)
- [The report endpoint](https://docs.methodfi.com/reference/reports/overview)
- [Retrieve a Report](https://docs.methodfi.com/reference/reports/retrieve)
- [Request IDs](https://docs.methodfi.com/reference/request-id)
- [Simulate an Event](https://docs.methodfi.com/reference/simulations/events/create)
- [The simulate endpoint](https://docs.methodfi.com/reference/simulations/overview)
- [Update a Payment's Status](https://docs.methodfi.com/reference/simulations/payments/update)
- [Create a Transaction](https://docs.methodfi.com/reference/simulations/transactions/create)
- [Versioning](https://docs.methodfi.com/reference/versioning)
- [Create a Webhook](https://docs.methodfi.com/reference/webhooks/create)
- [Delete a Webhook](https://docs.methodfi.com/reference/webhooks/delete)
- [List all Webhook](https://docs.methodfi.com/reference/webhooks/list)
- [The webhook endpoint](https://docs.methodfi.com/reference/webhooks/overview)
- [Retrieve a Webhook](https://docs.methodfi.com/reference/webhooks/retrieve)


## Optional

- [v1 Documentation](https://docs-v1.methodfi.com)


# October Updates



## Products

### Events API

![title](https://mintlify.s3-us-west-1.amazonaws.com/methodfinancial/images/events.png)
The [Events API](https://docs.methodfi.com/reference/events/overview) allows your application to monitor specific changes to Method resources.

*   For example, you can now be notified when an entity's credit score increases (event type: `credit_score.increased`)
    or if new derogatory marks appear (event type: `attribute.credit_health_derogatory_marks.increased`)

*   Events deliver detailed and actionable notifications across all Method products and resources, making webhooks more targeted and specific.
    This ensures you receive alerts for the updates that matter to your application and users.

*   Events are classified into two types:
    *   Literal changes: Direct updates to a specific field in a resource.
    *   Computed changes: Interpreted states derived from multiple field changes or comparisons across different records.

*   The Events API is now available to all teams on Method’s V2 API (version: 2024-04-04). This launch includes 10 initial events, with over 100 additional events planned for release in the coming weeks.

### Attributes API

![title](https://mintlify.s3-us-west-1.amazonaws.com/methodfinancial/images/attributes.png)
The [Attributes API](https://docs.methodfi.com/reference/entities/attributes/overview) offers a powerful summary of financial profile metrics across all Method API resources.

*   For example, it provides real-time indicators on credit utilization, payment reliability, account age, and derogatory marks, allowing developers to access these metrics directly without piecing together data from multiple endpoints.

*   Powered by Method’s real-time data integrations, it provides up-to-date insights ensuring your application accesses the most current data for faster, more informed decisions.

*   This initial release emphasizes credit health attributes, offering a holistic view of financial stability and risk.

*   For information on accessing the Attributes API, please reach out to your Method CSM.

***

## Improvements

### Card Brands API

*   Improved our card network integrations (Visa and Mastercard) to deliver lower latencies on Card Brands API requests.
*   Expanded coverage across all card products, including providing a reliable unique ID associated with each card product (for example all Chase Sapphire Reserve's across all entities will return the same brand ID)
    *   Brand ID is returned within `card_brand.brands[x].id` in the format `brand_*`.

### Credit Scores API

*   We've upgraded our Credit Scores API to use VantageScore 4.0, the latest version of the scoring model.
*   VantageScore 4.0 provides more predictive scoring by incorporating machine learning techniques and trended credit data, which analyzes credit behaviors over time rather than just a snapshot.
*   This upgrade enables more accurate credit risk assessment, especially for consumers with limited credit history.

***

## SDK Updates

*   Released [version 1.1.2](https://github.com/MethodFi/method-python/releases/tag/v1.1.2) of Method Python client (`method-python`).
    *   [Entity Attributes API](https://docs.methodfi.com/reference/entities/attributes/overview) is now available in the Python client.
    *   [Events API](https://docs.methodfi.com/reference/events/overview) is now available in the Python client.
*   Released [version 1.1.3](https://github.com/MethodFi/method-node/releases/tag/v1.1.3) of Method Node.js client (`method-node`).
    *   [Entity Attributes API](https://docs.methodfi.com/reference/entities/attributes/overview) is now available in the Node.js client.
    *   [Events API](https://docs.methodfi.com/reference/events/overview) is now available in the Node.js client.
*   Released [version 2 of Method API Postman Collection](https://www.postman.com/methodfi/method-api/collection/8d5j00b/method-api-v2).


# September Updates



## Improvements

### Performance & Infrastructure

*   Improved idempotency locking mechanism to handle simultaneous idempotent requests received across different regions / PoP.
*   Under-the-hood liability payment rail improvements to faster settlement time across all major FIs.
*   Card Brand has been optimized for increased success speed.
*   Expanded checks for invalid update payload from upstream data providers.

### Payment Coverage

*   Released new integration with SoFi Personal Loans for near real-time payment settlement speed.
*   Payment channels for Sallie Mae, US Bank, and AMEX have been revamped and optimized for speed of posting.
*   Additional personal loan payment channels have been enabled - improving payment coverage and speed to posting.
*   BMO Harris credit cards are now fully payable when account is connected via Method Connect.

### Developer Experience

*   `micro_deposits` verification sessions are now simulatable in dev.
*   Speed of `micro_deposists` simulation in dev environment has been increased.
*   Expanded Card Brand simulated response in dev environment.
*   Improved Student Loans [updates](https://docs.methodfi.com/reference/accounts/updates/overview) documentation for dev environment responses.
*   Element now throws an error if any of the requested products are not enabled for the requesting team.

### Account Connectivity

*   Improved account update stability for Quicken Loans, Home Depot (Citi), Credit One, and other major FIs.
*   "Instant Link" verification was optimized across all networks.
*   Visual interaction during the manual Connect Element flow have been streamlined to optimize for conversion.

### Reporting

*   Daily emailed reconciliation reports now include the team name in the subject line.
    *   e.g. (`Method: Daily ACH Report`) -> (`Method: Daily ACH Report for ${team_name}`)

***

## SDK Updates

*   Released [version 1.1.0](https://github.com/MethodFi/method-python/releases/tag/v1.1.0) of Method Python client (`method-python`).
    *   [Request ID](/reference/request-id) is now easily accessible via the `last_response` property - we highly recommend logging the request ID for faster issue resolution.
    *   This update also includes security updates and test coverage expansion.
*   Released [version 1.1.1](https://github.com/MethodFi/method-node/releases/tag/v1.1.1) of Method Node.js client (`method-node`).
    *   [Request ID](/reference/request-id) is now easily accessible via the `last_response` property - we highly recommend logging the request ID for faster issue resolution.
    *   This update also includes security updates and test coverage expansion.


# Introducing API v2



![title](https://mintlify.s3-us-west-1.amazonaws.com/methodfinancial/images/2024-04-04-hero-border.png)

We are excited to announce the launch of API v2 (release `2024-04-04`), the highly anticipated second version of Method's API.
Over the past year, our team has been dedicated to gathering feedback and working closely with our clients to create an even more powerful and developer-friendly API.

This release is packed with new features and enhancements that build upon Method's credential-less consumer permissioned financial network.

Expanded integrations with Visa/Mastercard power new features such as real-time credit card transaction notifications, and enabling 1-click checkout experiences for merchants.
This is in addition to our real-time financial institution liability updates, which have been significantly upgraded to provide better accuracy, expanded coverage, and reduced latency.

### Upgrading to 2024-04-04

The new API version is available to all existing teams.
New teams are automatically pinned to the API version `2024-04-04`.
During the transition phase, teams will be allowed to utilize any API version in tandem.

Note that once upgraded manually, it’s not possible to revert to older versions. Contact your Method CSM for more information on upgrade rollbacks.

*   **Request Header**: Set `Method-Version` to `2024-04-04`. See [API Versioning](/reference/versioning#api-versioning) for more information.
*   **Client Libraries**: For Method Libraries, the version is locked to the dated version of the API. For example, method-node v0.x.x is locked to 2020-12-06, while method-node v1.x.x is locked to 2024-04-04 and onwards.

#### Upgrade Support

Our technical integration team is here to help! Contact your Method CSM for a 1:1 on best practices and support migrating to `2024-04-04`

<Tip>Personalized upgrade guides have been created for enterprise customers. Contact your Method CSM to receive your guide.</Tip>

**✨ Ask Method:** The search bar of our docs now includes a conversational LLM search powered by ChatGPT. Feel free to ask any questions and receive a personalized answer.

*Sample questions:*

> How are auth\_sessions different in the new version of the API?

> What are the new products in 2024-04-04?

## Entities

New endpoints have been introduced for verification sessions, identities, connect operations, credit scores, products, and subscriptions. Several endpoints, including auth session, credit scores, and sensitive information retrieval, have been deprecated.

The connect endpoint now fetches all liability accounts across Method’s network of financial institutions, replacing auth\_session.
The verification sessions endpoint manages methods for verifying an entity's phone and identity, while the identities endpoint retrieves the underlying identity (PII) of an entity.
The products and subscriptions endpoints provide an overview of the products and continuous updates available for entities.

### New Features

#### The Connect endpoint

[Connect](/reference/entities/connect/overview) identifies and connects all the liability accounts (e.g., credit card, mortgage, auto loans, student loans, etc.)
for an entity across Method’s network of 1500+ financial institutions/lenders.

*   **The Connect endpoint replaces:**
    *   Auth Session: `POST /entities/{ent_id}/auth_session`

See [Connect](/reference/entities/connect/overview) for more information.

***

#### The Credit Scores endpoint

[Credit Scores](/reference/entities/credit-scores/overview) returns the latest credit score and score factors for an entity.

*   **The Credit Scores endpoint replaces:**
    *   Credit Score: `GET /entities/{ent_id}/credit_score`

See [Credit Scores](/reference/entities/credit-scores/overview) for more information.

***

#### The Verification Sessions Endpoint

[Entity Verification Sessions](/reference/entities/verification-sessions/overview) manage the methods for verifying an entity's phone and identity. Entities need to verify
their identity and/or phone to be used throughout the Method API. The status
of an entity's verification is returned via the `verification` field in the Entity object.

*   **The Verification Sessions endpoint replaces:**
    *   KBA questions via Auth Session: `POST /entities/{ent_id}/auth_session` is replaced by [kba](/reference/entities/verification-sessions/create-kba) entity verification session.
    *   Non-KBA authentication via Auth Session: `POST /entities/{ent_id}/auth_session` is replaced by [byo\_kyc](/reference/entities/verification-sessions/create-byo-kyc) entity verification session.
    *   `individual.phone_verification_type` and `individual.phone_verification_timestamp` via the create Entity request are replaced by [byo\_sms](/reference/entities/verification-sessions/create-byo-sms) phone verification requirements.
    *   Utilizing `capabilities`, `available_capabilities`, and `pending_capabilities` in the Entity object to verify if an entity's identity has been matched or if more PII is required.
        *   This flow is now replaced by `verification.identity.verified` and `verification.identity.matched` in the `verification` field in the Entity object.

*   **Upgrade notes:**
    *   The `verification` field in the Entity object returns the status of Identity Verification (`verification.identity`) and Phone Verification (`verification.phone`).
    *   The `method` key in the `entity.verification` object enumerates the phone and identity verifications available for your entity.
        *   Available verification methods differ on a team-by-team basis and are further defined by the PII provided during entity creation. See [PII Requirements](/reference/entities/overview#pii-requirements) for more information.
        *   Teams with pre-defined PII requirements can utilize `byo_kyc` to skip KBA, and `byo_sms` to skip phone verification.
    *   Teams upgrading from a prior API version might have some verifications auto-generated. Contact your Method CSM for more info.
    *   The `status` key in an entity will only transition to `active` when all verification requirements have been completed.

See [Verification Sessions](/reference/entities/verification-sessions/overview) for more information.

***

#### The Identities endpoint

Entity [Identities](/reference/entities/identities/overview) endpoint is used to retrieve the underlying identity (PII) of an Entity.

*   **The Identities endpoint replaces:**
    *   Entity Sensitive: `GET /entities/:entId/sensitive`

See [Identities](/reference/entities/identities/overview) for more information.

***

#### The Products endpoint

Entity [Products](/reference/entities/products/overview) endpoint outlines the products (*capabilities*) an entity has access to and provides an overview of the status of all the products.

Products are Method endpoints available for an entity. Access to most products requires an entity to be active.
However, some products have restricted access requiring team-by-team enablement. See [List all Products](/reference/entities/products/list) for more information.

**Entity Products:**

| Name           | Use-Case                                                             | Resource Doc                                                |
| -------------- | -------------------------------------------------------------------- | ----------------------------------------------------------- |
| `connect`      | On-Demand comprehensive view of an Entity’s outstanding liabilities. | [Connect](/reference/entities/connect/overview)             |
| `credit_score` | On-Demand view of an Entity’s credit score.                          | [Credit Scores](/reference/entities/credit-scores/overview) |
| `identity`     | On-Demand retrieval of the full Identity (PII) for any Entity        | [Identities](/reference/entities/identities/overview)       |

*   **The Products endpoint replaces:**
    *   Utilizing `capabilities`, `available_capabilities`, and `pending_capabilities` in the Entity object to determine the capabilities an entity has access to.
        These fields have been deprecated from the Entity object and removed in favor of:
        *   `products` (products available for this entity)
        *   `restricted_products` (products not currently available, but can be made available)

See [Products](/reference/entities/products/overview) for more information.

***

#### The Subscriptions endpoint

Entity [Subscriptions](/reference/entities/subscriptions/overview) 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*).

**Entity Subscriptions:**

| Name           | Use-Case                                                                                                            | Resource Doc                                                |
| -------------- | ------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------- |
| `connect`      | Comprehensive view of an Entity’s outstanding liabilities and continuous near real-time updates on new liabilities. | [Connect](/reference/entities/connect/overview)             |
| `credit_score` | Continuous near real-time updates on an Entity’s credit score.                                                      | [Credit Scores](/reference/entities/credit-scores/overview) |

*   **The Subscriptions endpoint replaces:**
    *   Custom configuration for continuous credit report pulls via your Method CSM. This has been deprecated and replaced by [Create a Subscription](/reference/entities/subscriptions/create) endpoint.

See [Subscriptions](/reference/entities/subscriptions/overview) for more information.

***

### Breaking Changes

#### Entity object changes

*   ✨ Corporation entity types have been simplified to `corporation` during [Create a Corporation](/reference/entities/create-corporation) entity.
    *   `c_corporation`, `s_corporation`, `llc`, `partnership`, and `sole_proprietorship` have been deprecated and removed in favor of `corporation`

*   ✨ Providing SSN is now supported during [Create an Individual](/reference/entities/create-individual) entity.
    *   `individual.ssn`, and `individual.ssn_4`

*   ✨ Entity verification status is now returned by the Entity object. See [Entity object](/reference/entities/overview) for more information.
    *   `verification`

*   ✨ Products and subscription status are now returned by the Entity object. See [Entity object](/reference/entities/overview) for more information.
    *   `products`
    *   `restricted_products`
    *   `subscriptions`
    *   `available_subscriptions`
    *   `restricted_subscriptions`

*   ⛔ Phone verification has been replaced and no longer returned by the Entity object.
    *   `individual.phone_verification_type`, and `individual.phone_verification_timestamp` have been deprecated and removed in favor of [Entity Verification Sessions](/reference/entities/verification-sessions/overview)

*   ⛔ Entity capabilities have been deprecated and removed from the Entity object.
    *   `capabilities`, `available_capabilities`, and `pending_capabilities` have been deprecated and removed in favor of [Products](/reference/entities/products/overview), [Subscriptions](/reference/entities/subscriptions/overview), and [Entity Verification Sessions](/reference/entities/verification-sessions/overview)
        *   The `verification` field in the Entity object returns the status of Identity Verification (`verification.identity`) and Phone Verification (`verification.phone`).
        *   The `products` array returns the products the entity has access to, replacing `capabilities`.
        *   The `restricted_products` array returns the products the entity does not have access to, replacing `pending_capabilities`.
        *   The [Entity Products](#) endpoint outlines the products (*capabilities*) an entity has access to and provides an overview of the status of all the products.

*   The following fields have been modified in the [Entity object](/reference/entities/overview):

    <AccordionGroup>
      <Accordion title="Fields removed from Entity" icon="circle-minus">
        *   `individual.phone_verification_type`
        *   `individual.phone_verification_timestamp`
        *   `capabilities`
        *   `available_capabilities`
        *   `pending_capabilities`
      </Accordion>

      <Accordion title="Fields added to Entity" icon="circle-plus">
        *   `individual.ssn`
        *   `individual.ssn_4`
        *   `verification`
        *   `products`
        *   `restricted_products`
        *   `subscriptions`
        *   `available_subscriptions`
        *   `restricted_subscriptions`
      </Accordion>
    </AccordionGroup>

#### Deprecated endpoints

The following endpoints have been deprecated and removed in `2024-04-04`

*   Auth Session: `/entities/{ent_id}/auth_session` removed in favor of [Connect](/reference/entities/connect/overview)
*   Credit Score: `/entities/{ent_id}/credit_score` removed in favor of [Credit Scores](/reference/entities/credit-scores/overview)
*   Entity Sensitive: `/entities/{ent_id}/sensitive` removed in favor of [Identities](/reference/entities/identities/overview)
*   Refresh Capabilities: `/entities/{ent_id}/refresh_capabilities` is no longer supported in `2024-04-04`
*   Manual Auth Session: `/entities/{ent_id}/manual_auth_session` is no longer supported in `2024-04-04`
*   Entity Vehicles: `/entities/{ent_id}/vehicles` is no longer supported in `2024-04-04`

## Accounts

New endpoints have been introduced for updates, card brands, payoffs, transactions, balances, verification sessions, and sensitive information. Several endpoints, including account syncs, account verification, and sensitive information retrieval, have been deprecated.

The updates endpoint now provides real-time account data directly from financial institutions, replacing syncs, and making liability account data available through the updates endpoint.

The verification process for ACH and liability accounts has been streamlined with Account Verification Sessions.

### New Features

#### The Updates endpoint

[Updates](/reference/accounts/updates/overview) endpoint retrieves in real-time account data including balance, due dates, APRs, directly from the account’s financial institution.
Updates is Method's flagship endpoint and replaces the `sync` endpoint by enabling push notifications directly from the financial institution.

As part of the `2024-04-04` release the Account object has been modified, and most Account data is now returned by an Update object. See [Account object changes](/changelog/api-versions/2024-04-04#account-object-changes) for more information.

*   **The Updates endpoint replaces:**
    *   Syncing an account using `/accounts/{acc_id}/syncs` has been deprecated and removed in favor of [Create an Update](/reference/accounts/updates/create)
    *   Enrolling in auto syncs using `/accounts/{acc_id}/sync_enrollment` or via your Method CSM has been deprecated and removed in favor of [Updates](/reference/accounts/updates/overview) and [Subscriptions](/reference/accounts/subscriptions/overview)
    *   Sync status fields in the Account response have been deprecated and removed in favor of [Updates](/reference/accounts/updates/overview). Removed fields include:
        *   `data_status`
        *   `data_sync_type`
        *   `data_last_successful_sync`
        *   `data_status_error`
        *   `data_source`
        *   `data_updated_at`
    *   Enrollment into credit report-based updates via your Method CSM has been deprecated and removed in favor of the `update.snapshot` subscription type. See [Subscriptions](/reference/accounts/subscriptions/overview) for more information.
    *   Liability data at the account level (`account.liability.<liability_type>`) has been deprecated and removed in favor of an Update object and an expansion. See [Account](/reference/accounts/overview) for more information.
    *   Utilizing `data_status` to determine real-time financial institution coverage has been deprecated and removed in favor of the `products` array including `updates`. See [Updates](/reference/accounts/updates/overview) for more information.

*   **Upgrade notes:**
    *   New updates sources: `direct` and monthly `snapshot` updates.
        *   `direct`: Near real-time account update (balance, due dates, etc.) from the account’s financial institution (replaces a `sync`).
        *   `snapshot`: Monthly snapshot update (balance, due dates, etc.) from the account’s financial institution (replaces credit report-based updates).
    *   Receiving continuous updates requires a subscription to `update` or `update.snapshot`. See [Subscriptions](/reference/accounts/subscriptions/overview) for more information.
    *   Liability data at the account level (`account.liability.<liability_type>`) has been deprecated and removed in favor of an Update object and an expansion. See [Account](/reference/accounts/overview) for more information.
    *   Any account connected using Entity Connect will receive an initial `snapshot` update and a `direct` update (when available).
    *   Legacy accounts connected via `auth_session` have been migrated with an Update object pre-populated.

See [Updates](/reference/accounts/updates/overview) for more information.

***

#### The Card Brand endpoint

[Card Brand](/reference/accounts/card-brands/overview) endpoint retrieves the associated credit card metadata (Product / Brand Name, Art, etc.) directly from the card issuer.
In the future, card brand webhooks will notify in real-time any card changes (e.g., card downgraded, card lost, etc.)

*   **The Card Brand endpoint replaces:**
    *   Derived card names in the liability account field `name`. Migrating to card brand will provide accurate names across any Visa / Mastercard card regardless of issuing bank.

See [Card Brand](/reference/accounts/card-brands/overview) for more information.

***

#### The Payoffs endpoint

[Payoffs](/reference/accounts/payoffs/overview) endpoint retrieves a payoff quote in real-time from the Account’s financial institution / lender. Payoffs are currently only available for Auto Loan and Mortgage accounts.

*   **The Payoffs endpoint replaces:**
    *   `payoff_amount` and `payoff_amount_term` fields within the `auto_loan` Account type response. See [Updates](/reference/accounts/updates/overview) for more information on the Account object changes.

See [Payoffs](/reference/accounts/payoffs/overview) for more information.

***

#### The Transactions endpoint

[Transactions](/reference/accounts/transactions/overview) endpoint retrieves real-time transaction (authorization, clearing, etc) notifications for Credit Card Accounts directly from the card networks (Visa, MC).

Enrollment for transactions requires a subscription and additional consent using Method's `connect` element.

*   **The Transactions endpoint replaces:**
    *   Enrollment for transactions using the `auth` element has been deprecated and removed in favor of the `connect` element. See [Connect Overview](/elements/connect/overview) for more information.
    *   Global transactions endpoint `/transactions` has been deprecated and removed in favor of account-scoped transactions. See [Transactions](/reference/accounts/transactions/overview) for more information.
    *   `transaction:stream` capability has been deprecated and removed in favor of the `transactions` product. See [Products](/reference/accounts/products/overview) for more information.

See [Transactions](/reference/accounts/transactions/overview) for more information.

***

#### The Balances endpoint

[Balances](/reference/accounts/balances/overview) endpoint retrieves the real-time balance from the account’s financial institution.
Balance is now available for non-liability accounts such as checking accounts. Contact your Method CSM for early access to expanded Balance coverage.

*   **The Balances endpoint replaces:**
    *   The `balance` field in `liability.<liability_type>.balance` has been deprecated and removed in favor of:
        *   Retrieving `balance` using the [Balances](/reference/accounts/balances/overview) endpoint
        *   Retrieving  `balance` and additional liability information using the [Updates](/reference/accounts/updates/overview) endpoint

See [Balances](/reference/accounts/balances/overview) for more information.

***

#### The Verification Sessions endpoint

[Account Verification Sessions](/reference/accounts/verification-sessions/overview) manage the methods for verifying an Account to enable specific products for ACH or Liability accounts. For example,
ACH Accounts require a verified Account Verification Session before they can be used as a source for Payments.

*   **The Account Verification Sessions endpoint replaces:**
    *   ACH Account verification via `/accounts/{acc_id}/verification` has been deprecated and removed in favor of:
        *   An Account Verification Session of one of the available methods: `micro_deposits`, `plaid`, `mx`, or `teller`.
        *   Teams with corporate disbursement ACH accounts can skip verification and a verification will be auto-provisioned with the type of `auto_verify`.
        *   Teams with managed DDAs can whitelist a routing number to skip verification across all their DDAs (routing / account number pair).
        *   See [Verification Types](/reference/accounts/verification-sessions/overview#verification-types) for more information.
            A verification of `trusted_provisioner` will be auto-provisioned. Contact your Method CSM for more information.
    *   Liability account number verification for AMEX, Apple Card, etc. is now handled by a `standard` Account Verification Session. See [Update a Standard Verification](/reference/accounts/verification-sessions/update-standard) for more information.
    *   Instant Link CVV verification is now handled by a `pre_auth` Account Verification Session. See [Update a Pre-auth Verification](/reference/accounts/verification-sessions/update-preauth) for more information.

*   **Upgrade notes:**
    *   Teams upgrading from a prior API version might have some verifications auto-generated. Contact your Method CSM for more info.

See [Account Verification Sessions](/reference/accounts/verification-sessions/overview) for more information.

***

#### The Sensitive endpoint

[Sensitive](/reference/accounts/sensitive/overview) endpoint returns underlying sensitive account information (e.g., PAN, CVV, account number).
This product is only available for liabilities and requires verification on a team-by-team basis.

*   **The Sensitive endpoint replaces:**
    *   `GET /accounts/{acc_id}/sensitive` is deprecated and removed in favor of [Create a Sensitive](/reference/accounts/sensitive/create).

See [Sensitive](/reference/accounts/sensitive/overview) for more information.

***

#### The Products endpoint

Account [Products](/reference/accounts/products/overview) endpoint outlines the products (*capabilities*) an account has access to and provides an overview of the status of all the products.

Products are Method endpoints available for an account. Most products are accessible by default.
However, some products have restricted access requiring team-by-team enablement and elevated account verification.

**Account Products:**

| Name         | Use-Case                                                                                                    | Supported Types | Resource Doc                                           |
| ------------ | ----------------------------------------------------------------------------------------------------------- | --------------- | ------------------------------------------------------ |
| `update`     | On-Demand real-time account update (balance, due dates, etc.) from the account's financial institution      | All liabilities | [Updates](/reference/accounts/updates/overview)        |
| `balance`    | On-Demand real-time balance from the account's financial institution                                        | All liabilities | [Balances](/reference/accounts/balances/overview)      |
| `card_brand` | On-Demand retrieval of credit card metadata (Product / Brand Name, Art, etc.) directly from the card issuer | Credit Cards    | [Card Brand](/reference/accounts/card-brands/overview) |
| `payoff`     | On-Demand retrieval of auto loan payoff (amount, per diem, etc.) from the account's financial institution   | Auto Loans      | [Payoffs](/reference/accounts/payoffs/overview)        |
| `payment`    | Next day electronic push payments to the account's financial institution                                    | All liabilities | [Payments](/reference/payments/overview)               |
| `sensitive`  | On-Demand retrieval of underlying sensitive account information (PAN, CVV, account number)                  | All liabilities | [Sensitive](/reference/accounts/sensitive/overview)    |

*   **The Products endpoint replaces:**
    *   Utilizing `capabilities`, `available_capabilities`, and `pending_capabilities` in the Account object to determine the capabilities an account has access to.
        These fields have been deprecated from the Account object and removed in favor of:
    *   `products` (products available for this Entity)
    *   `restricted_products` (products not currently available, but can be made available)

See [Products](/reference/accounts/products/overview) for more information.

***

#### The Subscriptions endpoint

Account [Subscriptions](/reference/accounts/subscriptions/overview) 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*).

**Account Subscriptions:**

| Name              | Use-Case                                                                                          | Supported Types | Resource Doc                                              |
| ----------------- | ------------------------------------------------------------------------------------------------- | --------------- | --------------------------------------------------------- |
| `transactions`    | Real-time transaction (authorization, purchases, etc.) notifications for credit card accounts     | Credit Cards    | [Transactions](/reference/accounts/transactions/overview) |
| `update`          | Near real-time account update (balance, due dates, etc.) from the account's financial institution | All liabilities | [Updates](/reference/accounts/updates/overview)           |
| `update.snapshot` | Monthly snapshot update (balance, due dates, etc.) from the account's financial institution       | All liabilities | [Updates](/reference/accounts/updates/overview)           |

*   **The Subscriptions endpoint replaces:**
    *   Custom configuration for continuous syncs via your Method CSM. This has been deprecated and replaced by [Create a Subscription](/reference/accounts/subscriptions/create) endpoint.
    *   Account Sync Enrollment `/accounts/{acc_id}/sync_enrollment` for enrollment in auto syncs. This has been deprecated and replaced with an Updates subscription. See [Updates](/reference/accounts/updates/overview) and [Create a Subscription](/reference/accounts/subscriptions/create) for more information.
    *   `data_sync_type` has been removed from the Account endpoint. See [Updates](/reference/accounts/updates/overview) and [List all Subscriptions](/reference/accounts/subscriptions/list) for more information.

See Account [Subscriptions](/reference/accounts/subscriptions/overview) for more information.

***

### Breaking Changes

#### Account object changes

*   ✨ Product properties are now included in the Account object. By default, the ID of the latest product resource is returned and can be
    expanded in-line using the `expand` query param. See [Expanding Resources](/reference/expanding) for more information.
    *   `latest_verification_session`
    *   `update`
    *   `balance`
    *   `card_brand`
    *   `payoff`

*   ✨ Products and Subscription status are now returned by the Account object. See [Account object](/reference/accounts/overview) for more information.
    *   `products`
    *   `restricted_products`
    *   `subscriptions`
    *   `available_subscriptions`
    *   `restricted_subscriptions`

*   ✨ Liability name and fingerprint are now returned by the Account object. See [Account object](/reference/accounts/overview) for more information.
    *   `liability.name`
    *   `liability.fingerprint`

*   ✨ New account liability types are now supported and returned by the Account object. See [Account Liability Types](/reference/accounts/overview#account-liability-types) for more information.

*   ⛔ Liability data under the `account.liability.<liability_type>` property has been deprecated and removed in favor of [Updates](/reference/accounts/updates/overview)
    *   The `updates` field returns the ID of the latest update and can be expanded to return liability account data in-line using the `expand` query param. See [Expanding Resources](/reference/expanding) for more information.

*   ⛔ Syncing liability data using `/accounts/{acc_id}/syncs` has been deprecated and removed in favor of [Updates](/reference/accounts/updates/overview)
    *   Additionally, data sync status fields at the account liability object have been deprecated and removed in favor of status fields within an [Update](/reference/accounts/updates/overview)
    *   `liability.data_status`, `liability.data_sync_type`, `liability.data_sync_type`, `liability.data_last_successful_sync`, `liability.data_source`,
        `liability.data_updated_at`, `liability.data_updated_at`, `liability.data_status_error`

*   ⛔ Account capabilities have been deprecated and removed from the Account object.
    *   `capabilities`, `available_capabilities`, and `pending_capabilities` have been deprecated and removed in favor of [Products](/reference/accounts/products/overview), [Subscriptions](/reference/accounts/subscriptions/overview), and [Account Verification Sessions](/reference/accounts/verification-sessions/overview)
        *   The `products` array returns the products the account has access to, replacing `capabilities`.
        *   The `restricted_products` array returns the products the account does not have access to, replacing `pending_capabilities`.
        *   The account [Products](/reference/accounts/products/overview) endpoint outlines the products (*capabilities*) an account has access to and provides an overview of the status of all the products.

*   ⛔ Account payment status (`liability.payment_status`) has been deprecated and removed in favor of [Products](/reference/accounts/products/overview)

*   ⛔ Account clearing (`clearing`) and liability hash (`liability.hash`) has been deprecated and removed in `2024-04-04`

*   The following fields have been modified in the [Account object](/reference/accounts/overview):

    <AccordionGroup>
      <Accordion title="Fields removed from Account" icon="circle-minus">
        *   `liability.payment_status`
        *   `liability.data_status`
        *   `liability.data_sync_type`
        *   `liability.data_last_successful_sync`
        *   `liability.data_source`
        *   `liability.data_updated_at`
        *   `liability.data_status_error`
        *   `liability._liability_type_` - where `liability_type` is any of the [Account Liability Types](/reference/accounts/overview#account-liability-types).
        *   `liability.hash`
        *   `clearing`
        *   `capabilities`
        *   `available_capabilities`
        *   `pending_capabilities`
      </Accordion>

      <Accordion title="Fields added to Account" icon="circle-plus">
        *   `liability.name`
        *   `liability.fingerprint`
        *   `latest_verification_session`
        *   `update`
        *   `balance`
        *   `card_brand`
        *   `payoff`
        *   `products`
        *   `restricted_products`
        *   `subscriptions`
        *   `available_subscriptions`
        *   `restricted_subscriptions`
      </Accordion>
    </AccordionGroup>

#### Deprecated endpoints

*   Account Syncs: `/accounts/{acc_id}/syncs` removed in favor of [Updates](/reference/accounts/updates/overview)
*   Account Sync Enrollment: `/accounts/{acc_id}/sync_enrollment` removed in favor of [Updates](/reference/accounts/updates/overview) and [Subscriptions](/reference/accounts/subscriptions/overview)
*   Account Verification: `/accounts/{acc_id}/verification` removed in favor of [Account Verification Sessions](/reference/accounts/verification-sessions/overview)
*   Account Sensitive: `/accounts/{acc_id}/sensitive` removed in favor of [Sensitive](/reference/accounts/sensitive/overview)
*   Account Card: `/accounts/{acc_id}/card` removed in favor of [Card Brand](/reference/accounts/card-brands/overview), [Sensitive](/reference/accounts/sensitive/overview) and Credit Card [Account Verification Sessions](/reference/accounts/verification-sessions/overview)
*   Account Payment History: `/accounts/{acc_id}/payment_history` is no longer supported in `2024-04-04`
*   Account Details: `/accounts/{acc_id}/details` is no longer supported in `2024-04-04`
*   Bulk Sensitive: `/accounts/{acc_id}/bulk_sensitive` is no longer supported in `2024-04-04`
*   Bulk Sync: `/accounts/{acc_id}/bulk_sync` is no longer supported in `2024-04-04`
*   Account Vehicle: `/accounts/{acc_id}/match_vehicle` is no longer supported in `2024-04-04`
*   Routing Numbers: `/routing_numbers` is no longer supported in `2024-04-04`
*   BINs: `/bins` is no longer supported in `2024-04-04`

## Additional Changes

### Expand Parameter

New `expand` query parameter for expanding certain properties from an ID to their respective objects in-line in the response body.

Applicable to both Entities and Accounts, allowing expansion of fields such as `connect`, `credit_score`, `update`, `balance`, `payoff`, `sensitive`, `transactions`, `card_brand`, and `latest_verification_session`.

See [Expanding Resources](/reference/expanding) for more information.

### Elements

Introducing the [Connect element](/elements/connect/overview) as the primary way to connect user accounts and complete necessary verifications.

The Auth element has been deprecated in favor of Connect.

See [Connect guide](/elements/connect/overview) for step-by-step instructions on leveraging Connect.


# Create a Connect Element Token



To start using Connect, you will first need to create a [Connect Element Token](/reference/elements/tokens). There are a few different use cases that will determine what you pass to the endpoint.

### New Entities

If you do not have any identity information about your users, you will likely create a token using a payload similar to this:

```json
{
  "type": "connect",
  "connect": {
    "products": ["balance"],
    "entity": {
      "type": "individual",
      "individual": {}
    }
  }
}
```

This will return a token that you can use to create a new entity and connect their accounts. Fill in the `products` array with a list of the different products you want to connect (for example `["balance", "card"]`).

### New Entities with Partial Information

If you have some information already about a given user (such as their name), you can pass that information into the `individual` object:

```json
{
  "type": "connect",
  "connect": {
    "products": ["balance"],
    "entity": {
      "type": "individual",
      "individual": {
        "first_name": "Kevin",
        "last_name": "Doyle"
      }
    }
  }
}
```

You can also pass in a user's phone number, address, DOB, or the last 4 digits of their SSN to make the identity verification process faster.

### Using with Existing Entities

You can also pass in an existing entity\_id:

```json
{
  "type": "connect",
  "entity_id": "ent_au22b1fbFJbp8",
  "connect": {
    "products": ["balance"]
  }
}
```

### Using with Existing Accounts

If you also have specific accounts you'd like to connect, you can pass the account ids:

```json
{
  "type": "connect",
  "entity_id": "ent_au22b1fbFJbp8",
  "connect": {
    "products": ["balance"],
    "accounts": ["acc_k8LAKDnED7kti", "acc_KUaFnxn7eUAeH"]
  }
}
```

<RequestExample>
  ```bash cURL
  curl https://dev.methodfi.com/elements/token \
    -X POST \
    -H "Method-Version: 2024-04-04" \
    -H "Authorization: Bearer sk_WyZEWVfTcH7GqmPzUPk65Vjc" \
    -H "Content-Type: application/json" \
    -d '{
      "type": "connect",
      "connect": {
        "products": ["balance"],
        "entity": {
          "type": "individual",
          "individual": {
            "first_name": "Kevin",
            "last_name": "Doyle"
          }
        }
      }
    }'
  ```

  ```javascript Node.js
  const token = await method.elements.token.create({
    type: "connect",
    connect: {
      products: ["balance"],
      entity: {
        type: "individual",
        individual: {
          first_name: "Kevin",
          last_name: "Doyle"
        }
      }
    }
  });
  ```

  ```python Python
  token = method.elements.token.create({
    'type': "connect",
    'connect': {
      'products': ["balance"],
      'entity': {
        'type': "individual",
        'individual': {
          'first_name': "Kevin",
          'last_name': "Doyle"
        }
      }
    }
  })
  ```
</RequestExample>

<ResponseExample>
  ```json
  {
    "element_token": "pk_elem_qPmypE9wwphr3WL3yTj7JhxjrPzAmK8G"
  }
  ```
</ResponseExample>


# Getting Connect Results



export const ParamList = ({items, is_child = false}) => {
  return items.map(item => {
    const field_props = {
      id: Math.random().toString(),
      body: item.name,
      name: item.name,
      type: item.type,
      required: item.required
    };
    const enums = item.enums || [];
    const items = item.items || [];
    const has_items = items?.length > 0;
    const has_enums = enums?.length > 0;
    const should_default_open = item.defaultOpen | false;
    const render_child_item = () => {
      const child_props = {
        title: has_enums ? "Possible enum values" : "properties"
      };
      if (should_default_open) child_props.defaultOpen = true;
      const has_inline_enums = has_enums && enums.every(enum_item => typeof enum_item === 'string') && enums.map((enum_item, idx) => {
        const is_last = idx === enums.length - 1;
        const is_2nd_to_last = idx === enums.length - 2;
        return <>
            <code>{enum_item}</code>
            {is_last && ''}
            {is_2nd_to_last && ' or '}
            {!is_last && !is_2nd_to_last && ', '}
          </>;
      });
      const enum_list = has_enums && !has_inline_enums && <Accordion {...child_props}>
          {enums.map(enum_item => <>
              <code>{enum_item.name}</code>
              <br />
              <p>{enum_item.description}</p>
            </>)}
        </Accordion>;
      const item_list = has_items && <Expandable {...child_props}>
          <ParamList items={items || []} is_child />
        </Expandable>;
      return <>
          <p>
            {item.description}
            {has_inline_enums && [has_inline_enums.length > 1 ? ' One of ' : ' Must be ', ...has_inline_enums]}
          </p>

          {enum_list}
          {item_list}
        </>;
    };
    return is_child ? <ResponseField {...field_props}>{render_child_item()}</ResponseField> : <ParamField {...field_props}>{render_child_item()}</ParamField>;
  });
};

In addition to [listening for the success event](/elements/events/overview), the result of the Connect session can also be retrieved by calling the `results` endpoint with the element token for that session.

```bash
GET /elements/token/:element_token/results
```

See [Retrieve Element Results](/reference/elements/results) for more information about this endpoint.

<RequestExample>
  ```bash cURL
  curl https://production.methodfi.com/elements/token/pk_elem_dDe4r9M6X3Ad9zjpbgYpzLNtRCXfhPYR/results \
    -X GET \
    -H "Method-Version: 2024-04-04" \
    -H "Authorization: Bearer sk_WyZEWVfTcH7GqmPzUPk65Vjc"
  ```

  ```javascript Node.js
  const response = await method
    .elements
    .token
    .results('pk_elem_dDe4r9M6X3Ad9zjpbgYpzLNtRCXfhPYR');
  ```

  ```python Python
  response = method
    .elements
    .token
    .results('pk_elem_dDe4r9M6X3Ad9zjpbgYpzLNtRCXfhPYR')
  ```
</RequestExample>

<ResponseExample>
  ```json
  {
    "authenticated": true,
    "cxn_id": "cxn_xr86xHEcWmpmB",
    "accounts": [
      "acc_jPXLFqd6KzH3N",
      "acc_DALLeLrj3TH8h"
    ],
    "entity_id": "ent_GWKYtnFyE79db",
    "events": [
      {
        "type": "open",
        "metadata": {
          "element_type": "connect",
          "op": "open"
        },
        "timestamp": "2024-04-25T02:35:28.097Z"
      },
      {
        "type": "success",
        "metadata": {
          "entity_id": "ent_GWKYtnFyE79db",
          "accounts": [
            "acc_jPXLFqd6KzH3N",
            "acc_DALLeLrj3TH8h"
          ],
          "element_type": "connect",
          "op": "success"
        },
        "timestamp": "2024-04-25T02:35:57.120Z"
      },
      {
        "type": "exit",
        "metadata": {
          "element_type": "connect",
          "op": "exit"
        },
        "timestamp": "2024-04-25T02:35:57.138Z"
      }
    ]
  }
  ```
</ResponseExample>


# Launching a Connect Session



After creating a Connect Element token, you can launch a Connect session in a webview.

## Initializing the Connect Element

The Connect Element is optimized to work within Webviews, including on iOS and Android. Open a webview in your app to your desired environment using the `element_token` you generated.

Example:

Using the [Element SDK](/elements/libraries) (recommended):

```javascript
method.open('pk_elem_BtzySdrQGFmLdAPw5gXSQNCxQkhCkT3K');
```

Without SDK:

```bash
https://elements.production.methodfi.com/
  ?token=pk_elem_4PpMTPcchb49VBjwP3bREKhMN93hrQHR
```


# Connect Overview



Connect is the primary way to leverage Method Elements to connect your users' liabilities. Connect allows you to verify a user's identity, gather their consent, and complete any needed verifications to ensure their accounts are connected to the desired Method [Products](/reference/accounts/products/overview).

The Connect element itself consists of two main steps:

<Steps>
  <Step title="Auth">
    Verify the user's identity and connect their accounts. If no entity information is provided when creating the Connect element token, the user will be asked to provide identity information such as name, phone, last 4 digits of SSN, DOB, or address.
  </Step>

  <Step title="Account Verification">
    Request any additional information needed from the user to connect their accounts and leverage specific products.
  </Step>
</Steps>


# Environments



Elements are available in each of our three [Environments](/reference/environments):

```
https://elements.dev.methodfi.com (Development)
https://elements.sandbox.methodfi.com (Sandbox)
https://elements.production.methodfi.com (Production)
```

## Considerations for Connect

When using the [Connect Element](/elements/connect/overview), there are a few things to keep in mind related to the different environments.

### Development Environment

In dev, you can use the following phone numbers to ensure your entity gets verified:

```bash
Phone        | Required Fields
------------------------------
+15121231111 | Name, Phone
+15121231112 | Name, Phone, DOB (Date of Birth)
+15121231113 | Name, Phone, DOB (Date of Birth), Address
```

You can either pass in the required fields on token creation or during the Connect session.

**Note**: If you do not use one of the above phone numbers, your dev entities will not be verified.


# General Events



export const ParamList = ({items, is_child = false}) => {
  return items.map(item => {
    const field_props = {
      id: Math.random().toString(),
      body: item.name,
      name: item.name,
      type: item.type,
      required: item.required
    };
    const enums = item.enums || [];
    const items = item.items || [];
    const has_items = items?.length > 0;
    const has_enums = enums?.length > 0;
    const should_default_open = item.defaultOpen | false;
    const render_child_item = () => {
      const child_props = {
        title: has_enums ? "Possible enum values" : "properties"
      };
      if (should_default_open) child_props.defaultOpen = true;
      const has_inline_enums = has_enums && enums.every(enum_item => typeof enum_item === 'string') && enums.map((enum_item, idx) => {
        const is_last = idx === enums.length - 1;
        const is_2nd_to_last = idx === enums.length - 2;
        return <>
            <code>{enum_item}</code>
            {is_last && ''}
            {is_2nd_to_last && ' or '}
            {!is_last && !is_2nd_to_last && ', '}
          </>;
      });
      const enum_list = has_enums && !has_inline_enums && <Accordion {...child_props}>
          {enums.map(enum_item => <>
              <code>{enum_item.name}</code>
              <br />
              <p>{enum_item.description}</p>
            </>)}
        </Accordion>;
      const item_list = has_items && <Expandable {...child_props}>
          <ParamList items={items || []} is_child />
        </Expandable>;
      return <>
          <p>
            {item.description}
            {has_inline_enums && [has_inline_enums.length > 1 ? ' One of ' : ' Must be ', ...has_inline_enums]}
          </p>

          {enum_list}
          {item_list}
        </>;
    };
    return is_child ? <ResponseField {...field_props}>{render_child_item()}</ResponseField> : <ParamField {...field_props}>{render_child_item()}</ParamField>;
  });
};

## Open

The open event is triggered when an element has successfully launched. No additional data is passed at this time.

```bash
methodelements://general
  ?op=open
  &element_type=connect
```

The event payload will have the following form:

<ParamList
  items={[
  {
  name: 'op',
  type: 'string',
  description: 'The operation type returned by the element.',
  },
  {
  name: 'element_type',
  type: 'string',
  description: (
    <>
      The name of the element that triggered the event. Possible values are:{" "}
      <code>connect</code>,{" "}
      <code>auth</code>,{" "}
      <code>account_verify</code>,{" "}
      <code>unknown</code>
    </>
  ),
  }
  ]}
/>

## Error

The error event is sent for any element that encounters any error while it's active.

```bash
methodelements://general
  ?op=error
  &element_type=unknown
  &type=INVALID_REQUEST
  &sub_type=EXPIRED_TOKEN
  &message=The public element token is no longer valid. Element tokens are short lived and can only be used once. Request a new element token and try your request again.
  &code=400
```

The event payload will have the following form:

<ParamList
  items={[
  {
  name: 'op',
  type: 'string',
  description: 'The operation type returned by the element.',
  },
  {
  name: 'element_type',
  type: 'string',
  description: (
    <>
      The name of the element that triggered the event. Possible values are:{" "}
      <code>connect</code>,{" "}
      <code>auth</code>,{" "}
      <code>account_verify</code>,{" "}
      <code>unknown</code>
    </>
  ),
  },
  {
  name: 'code',
  type: 'integer',
  description: 'The status code of the response.',
  },
  {
  name: 'type',
  type: 'string',
  description: 'A broad description of the error',
  },
  {
  name: 'sub_type',
  type: 'string',
  description: 'The specific error type',
  },
  {
  name: 'message',
  type: 'string',
  description: 'A human-readable message providing more details about the error',
  },
  ]}
/>

## Exit

The exit event is the last event in the element flow, at this point your app should no longer present the Method Element. Exit is triggered after an error, a user requested exit or a successful element event.

```bash
methodelements://general
  ?op=exit
  &element_type=connect
```

The event payload will have the following form:

<ParamList
  items={[
  {
  name: 'op',
  type: 'string',
  description: 'The operation type returned by the element.',
  },
  {
  name: 'element_type',
  type: 'string',
  description: (
    <>
      The name of the element that triggered the event. Possible values are:{" "}
      <code>connect</code>,{" "}
      <code>auth</code>,{" "}
      <code>account_verify</code>,{" "}
      <code>unknown</code>
    </>
  ),
  }
  ]}
/>


# Events Overview



export const ParamList = ({items, is_child = false}) => {
  return items.map(item => {
    const field_props = {
      id: Math.random().toString(),
      body: item.name,
      name: item.name,
      type: item.type,
      required: item.required
    };
    const enums = item.enums || [];
    const items = item.items || [];
    const has_items = items?.length > 0;
    const has_enums = enums?.length > 0;
    const should_default_open = item.defaultOpen | false;
    const render_child_item = () => {
      const child_props = {
        title: has_enums ? "Possible enum values" : "properties"
      };
      if (should_default_open) child_props.defaultOpen = true;
      const has_inline_enums = has_enums && enums.every(enum_item => typeof enum_item === 'string') && enums.map((enum_item, idx) => {
        const is_last = idx === enums.length - 1;
        const is_2nd_to_last = idx === enums.length - 2;
        return <>
            <code>{enum_item}</code>
            {is_last && ''}
            {is_2nd_to_last && ' or '}
            {!is_last && !is_2nd_to_last && ', '}
          </>;
      });
      const enum_list = has_enums && !has_inline_enums && <Accordion {...child_props}>
          {enums.map(enum_item => <>
              <code>{enum_item.name}</code>
              <br />
              <p>{enum_item.description}</p>
            </>)}
        </Accordion>;
      const item_list = has_items && <Expandable {...child_props}>
          <ParamList items={items || []} is_child />
        </Expandable>;
      return <>
          <p>
            {item.description}
            {has_inline_enums && [has_inline_enums.length > 1 ? ' One of ' : ' Must be ', ...has_inline_enums]}
          </p>

          {enum_list}
          {item_list}
        </>;
    };
    return is_child ? <ResponseField {...field_props}>{render_child_item()}</ResponseField> : <ParamField {...field_props}>{render_child_item()}</ParamField>;
  });
};

Communication between the Element and your app can be handled either by PostMessage communication or via HTTP redirects.

## Listening to Events

We strongly recommend using one of the [Element SDKs](/elements/libraries) to make listening to events easy. They provide you with callback functions that are invoked every time a specific type of event occurs (such as `open`, `success`, `exit`, etc).

Each type of Element will emit its own events. See [General Events](/elements/events/general_events) and [Element Specific Events](/elements/events/specific_events) for more information about the events that are emitted.

### PostMessage without SDK

To recieve events via PostMessage, pass the query parameter `event_channel=message` to the Elements url. For example:

```bash
https://elements.production.methodfi.com
  ?token=pk_elem_4PpMTPcchb49VBjwP3bREKhMN93hrQHR
  &event_channel=message
```

To listen to the emitted events, add an event listener onto the window object:

```javascript
window.addEventListener('message', function(event) {
  const { payload, type } = event.data;
  console.log('Received event!', type, payload);
});
```

### Redirects

Redirects are the default way of listening to element events if you are not using one of the SDKs. Your webview / app should intercept the redirects in order to react accordingly to state changes. All redirect URLs will have the scheme ("prefix") `methodelements`. The event source will be the URL host and the payload will be query strings.

HTTP redirects from Method Elements are in the following format:

```bash
methodelements://{event_source}?{event_data}
```


# Element Specific Events



export const ParamList = ({items, is_child = false}) => {
  return items.map(item => {
    const field_props = {
      id: Math.random().toString(),
      body: item.name,
      name: item.name,
      type: item.type,
      required: item.required
    };
    const enums = item.enums || [];
    const items = item.items || [];
    const has_items = items?.length > 0;
    const has_enums = enums?.length > 0;
    const should_default_open = item.defaultOpen | false;
    const render_child_item = () => {
      const child_props = {
        title: has_enums ? "Possible enum values" : "properties"
      };
      if (should_default_open) child_props.defaultOpen = true;
      const has_inline_enums = has_enums && enums.every(enum_item => typeof enum_item === 'string') && enums.map((enum_item, idx) => {
        const is_last = idx === enums.length - 1;
        const is_2nd_to_last = idx === enums.length - 2;
        return <>
            <code>{enum_item}</code>
            {is_last && ''}
            {is_2nd_to_last && ' or '}
            {!is_last && !is_2nd_to_last && ', '}
          </>;
      });
      const enum_list = has_enums && !has_inline_enums && <Accordion {...child_props}>
          {enums.map(enum_item => <>
              <code>{enum_item.name}</code>
              <br />
              <p>{enum_item.description}</p>
            </>)}
        </Accordion>;
      const item_list = has_items && <Expandable {...child_props}>
          <ParamList items={items || []} is_child />
        </Expandable>;
      return <>
          <p>
            {item.description}
            {has_inline_enums && [has_inline_enums.length > 1 ? ' One of ' : ' Must be ', ...has_inline_enums]}
          </p>

          {enum_list}
          {item_list}
        </>;
    };
    return is_child ? <ResponseField {...field_props}>{render_child_item()}</ResponseField> : <ParamField {...field_props}>{render_child_item()}</ParamField>;
  });
};

## Connect

Connect will emit a `success` event when the user has successfully completed all required authentication and verification:

```bash
methodelements://connect
  ?op=success
  &element_type=connect
  &entity_id=ent_WyDmJnQgaxVRH
  &accounts=["acc_PFUNazUbpUpfm","acc_gjWr4Cb8H7TLz"]
```

When parsed, will result in the following JSON

```json
{
  "op": "success",
  "element_type": "connect",
  "entity_id": "ent_WyDmJnQgaxVRH",
  "accounts": ["acc_PFUNazUbpUpfm","acc_gjWr4Cb8H7TLz"]
}
```

This will list all of the accounts that were consented and connected to at least one of the products passed into the Element token creation (Note: Some accounts are ineligible for some products).

## Other Events

For more granular information about specific actions a user is taking, `auth` and `account_verification` will emit the following events.

### Auth

Auth will emit a variety of events that describe how the user is progressing through the authentication process. Most events are of the following form:

```bash
AUTH_{STEP}_{ACTION}
```

STEP will reference a step during the auth process: `INTRO`, `NAME`, `PHONE`, `PHONE_VERIFY`, `DOB`, `ADDRESS`, `SSN4`, `SECQ`, and `CONSENT`.

ACTION will refer to the action the user took: `OPEN`, `CONTINUE`, `SUBMIT`, and `CLOSE`.

**Note**: Not all steps will have all actions, and that there are a few actions that do not follow this pattern

For example, if the user was prompted for the last 4 of their SSN, then submitted their info and was directed to the DOB page, you would see the following events:

```bash
AUTH_SSN4_OPEN
AUTH_SSN4_CONTINUE
AUTH_DOB_OPEN
```

### Account Verification

Account Verification will emit a variety of events using a similar structure to auth:

```bash
AVF_{STEP}_{ACTION}
```

STEP will reference a step during the account verification process: `ACCOUNT_LIST`, `LEARN_MORE`, and `ACCOUNT_VERIFY`.

ACTION will refer to the action the user took: `OPEN`, `CONTINUE`, `SUBMIT`, `SKIP`, and `CLOSE`.

For example, if the user was prompted to verify their credit card, then submitted their info and was directed to the success screen, you would see the following events:

```bash
AVF_ACCOUNT_VERIFY_OPEN
AVF_ACCOUNT_VERIFY_SUBMIT
AVF_SUCCESS_OPEN
```


# Element SDKs



Method offers a variety of libraries for your frontend application to make integrating with Elements easy and simple. We also offer [backend libraries](TODO:Where_is_link) to help manage token creation and using the API more broadly.

## Frontend Libraries

Depending on your application, Method offers three different frontend libraries to help you integrate with Element:

1.  [method-js](https://docs.methodfi.com/libraries/js-sdk), for vanilla JavaScript applications
2.  [react-method-elements](https://github.com/MethodFi/react-method-elements), for React applications
3.  [react-native-method-elements](https://github.com/MethodFi/react-native-method-elements), for React Native applications


# Overview



Method Elements is a collection of embeddable UI components that make easy to integrate Method's API into your experience. Using Method Elements, you can securely identify your users, connect their liabilites, and move money across accounts.

## Using Method Elements

<Steps>
  <Step title="Create Element Token">
    Your app's backend will generate an `element_token` by hitting the [/elements/token](/reference/elements/tokens) endpoint.
  </Step>

  <Step title="Initialize Element">
    Using the `element_token`, Method Elements will be [initialized](/elements/libraries) with the intended Element for your user.
  </Step>

  <Step title="Handling Element Events">
    While your user interacts with an Element, [events](/elements/events/overview) will be triggered for your app to handle.
  </Step>
</Steps>

### Authentication

Ensure you have an [API key created](/reference/authentication) for your organization in order to request an Element token.


# Overview



Method offers a list official libraries that help developers easily
interact and build on top of the Method services.

## API client Libraries

Below is a list of libraries for each supported programming language. These
libraries are updated frequently to provide the best developer experience
when interacting with the Method API.

<CardGroup cols={2}>
  <Card title="Node.js" icon={<img src="https://docs-v1.methodfi.com/img/libraries/nodejs-logo.png" />} href="https://github.com/MethodFi/method-node" />

  <Card title="Python" icon={<img src="https://docs-v1.methodfi.com/img/libraries/python-logo.png" />} href="https://github.com/MethodFi/method-python" />
</CardGroup>

## Element client libraries

Method supports a list of frontend libraries to make integrating Element
into your applications more seamless.

<CardGroup cols={2}>
  <Card title="Javascript" icon={<img src="https://docs-v1.methodfi.com/img/libraries/js-logo.png" />} href="/libraries/js-sdk" />

  <Card title="React" icon={<img src="https://docs-v1.methodfi.com/img/libraries/react-logo.png" />} href="https://github.com/MethodFi/react-method-elements" />

  <Card title="React Native" icon={<img src="https://docs-v1.methodfi.com/img/libraries/react-native-logo.svg" />} href="https://github.com/MethodFi/react-native-method-elements" />
</CardGroup>

## Quickstart and examples

We've built a couple of quickstart applications to help you get started with
seamlessly building on top of Method.

<CardGroup cols={2}>
  <Card title="Postman" icon={<img src="https://docs-v1.methodfi.com/img/libraries/postman-logo.png" />} href="https://www.postman.com/methodfi/method-api/collection/8d5j00b/method-api-v2" />
</CardGroup>


# Create a Balance

POST /accounts/{acc_id}/balances

export const ParamList = ({items, is_child = false}) => {
  return items.map(item => {
    const field_props = {
      id: Math.random().toString(),
      body: item.name,
      name: item.name,
      type: item.type,
      required: item.required
    };
    const enums = item.enums || [];
    const items = item.items || [];
    const has_items = items?.length > 0;
    const has_enums = enums?.length > 0;
    const should_default_open = item.defaultOpen | false;
    const render_child_item = () => {
      const child_props = {
        title: has_enums ? "Possible enum values" : "properties"
      };
      if (should_default_open) child_props.defaultOpen = true;
      const has_inline_enums = has_enums && enums.every(enum_item => typeof enum_item === 'string') && enums.map((enum_item, idx) => {
        const is_last = idx === enums.length - 1;
        const is_2nd_to_last = idx === enums.length - 2;
        return <>
            <code>{enum_item}</code>
            {is_last && ''}
            {is_2nd_to_last && ' or '}
            {!is_last && !is_2nd_to_last && ', '}
          </>;
      });
      const enum_list = has_enums && !has_inline_enums && <Accordion {...child_props}>
          {enums.map(enum_item => <>
              <code>{enum_item.name}</code>
              <br />
              <p>{enum_item.description}</p>
            </>)}
        </Accordion>;
      const item_list = has_items && <Expandable {...child_props}>
          <ParamList items={items || []} is_child />
        </Expandable>;
      return <>
          <p>
            {item.description}
            {has_inline_enums && [has_inline_enums.length > 1 ? ' One of ' : ' Must be ', ...has_inline_enums]}
          </p>

          {enum_list}
          {item_list}
        </>;
    };
    return is_child ? <ResponseField {...field_props}>{render_child_item()}</ResponseField> : <ParamField {...field_props}>{render_child_item()}</ParamField>;
  });
};

Creates a new Balance request to retrieve the Account's balance from the financial institution.

Operation Type: <Tooltip tip="Your request is processed in the background. You'll receive a webhook when it's complete.">⏳ Asynchronous</Tooltip> | [Webhook Payload](overview#webhook-payload).

## Path Parameters

<ParamList
  items={[
  {
  name: 'acc_id',
  type: 'string',
  required: true,
  description: 'ID of the Account.',
  },
  ]}
/>

## Returns

Returns a Balance object.

<RequestExample>
  ```bash cURL
  curl https://production.methodfi.com/accounts/acc_yVf3mkzbhz9tj/balances \
    -X POST \
    -H "Method-Version: 2024-04-04" \
    -H "Authorization: Bearer sk_WyZEWVfTcH7GqmPzUPk65Vjc"
  ```

  ```javascript Node.js
  const response = await method
    .accounts('acc_yVf3mkzbhz9tj')
    .balances
    .create();
  ```

  ```python Python
  response = method
    .accounts('acc_yVf3mkzbhz9tj')
    .balances
    .create()
  ```
</RequestExample>

<ResponseExample>
  ```json
  {
    "id": "bal_dGCCNWHMQYRay",
    "account_id": "acc_yVf3mkzbhz9tj",
    "status": "in_progress",
    "amount": null,
    "error": null,
    "created_at": "2024-03-14T01:41:28.434Z",
    "updated_at": "2024-03-14T01:41:28.434Z"
  }
  ```
</ResponseExample>


# List all Balances

GET /accounts/{acc_id}/balances

export const get_pagination_defaults = (resource_name = 'records') => [{
  name: 'from_date',
  type: 'string',
  required: false,
  description: `ISO 8601 formatted date (YYYY-MM-DD) to filter for ${resource_name} created on and after the date provided.`
}, {
  name: 'to_date',
  type: 'string',
  required: false,
  description: `ISO 8601 formatted date (YYYY-MM-DD) to filter for ${resource_name} created on and before the date provided.`
}, {
  name: 'page',
  type: 'string',
  required: false,
  description: `The number of the page to return.`
}, {
  name: 'page_cursor',
  type: 'string',
  required: false,
  description: <>
        The ID of a resource from which a page should start or end. Mutually exclusive with <code>page</code>.
      </>
}, {
  name: 'page_limit',
  type: 'string',
  required: false,
  description: `The number of ${resource_name} to return per page.`
}];

export const ParamList = ({items, is_child = false}) => {
  return items.map(item => {
    const field_props = {
      id: Math.random().toString(),
      body: item.name,
      name: item.name,
      type: item.type,
      required: item.required
    };
    const enums = item.enums || [];
    const items = item.items || [];
    const has_items = items?.length > 0;
    const has_enums = enums?.length > 0;
    const should_default_open = item.defaultOpen | false;
    const render_child_item = () => {
      const child_props = {
        title: has_enums ? "Possible enum values" : "properties"
      };
      if (should_default_open) child_props.defaultOpen = true;
      const has_inline_enums = has_enums && enums.every(enum_item => typeof enum_item === 'string') && enums.map((enum_item, idx) => {
        const is_last = idx === enums.length - 1;
        const is_2nd_to_last = idx === enums.length - 2;
        return <>
            <code>{enum_item}</code>
            {is_last && ''}
            {is_2nd_to_last && ' or '}
            {!is_last && !is_2nd_to_last && ', '}
          </>;
      });
      const enum_list = has_enums && !has_inline_enums && <Accordion {...child_props}>
          {enums.map(enum_item => <>
              <code>{enum_item.name}</code>
              <br />
              <p>{enum_item.description}</p>
            </>)}
        </Accordion>;
      const item_list = has_items && <Expandable {...child_props}>
          <ParamList items={items || []} is_child />
        </Expandable>;
      return <>
          <p>
            {item.description}
            {has_inline_enums && [has_inline_enums.length > 1 ? ' One of ' : ' Must be ', ...has_inline_enums]}
          </p>

          {enum_list}
          {item_list}
        </>;
    };
    return is_child ? <ResponseField {...field_props}>{render_child_item()}</ResponseField> : <ParamField {...field_props}>{render_child_item()}</ParamField>;
  });
};

Retrieve a list of Balances requests for a specific Account.

## Path Parameters

<ParamList
  items={[
  {
  name: 'acc_id',
  type: 'string',
  required: true,
  description: 'ID of the Account.',
  }
  ]}
/>

## Query Parameters

<ParamList
  items={[
  ...get_pagination_defaults('Balances'),
  ]}
/>

## Returns

Returns a list of Balances.

<RequestExample>
  ```bash cURL
  curl "https://production.methodfi.com/acc_yVf3mkzbhz9tj/balances" \
    -H "Method-Version: 2024-04-04" \
    -H "Authorization: Bearer sk_WyZEWVfTcH7GqmPzUPk65Vjc"
  ```

  ```javascript Node.js
  const response = await method
    .accounts('acc_yVf3mkzbhz9tj')
    .balances
    .list();
  ```

  ```python Python
  response = method
    .accounts('acc_yVf3mkzbhz9tj')
    .balances
    .list()
  ```
</RequestExample>

<ResponseExample>
  ```json
  {
    "data": [
      {
        "id": "bal_ebzh8KaR9HCBG",
        "account_id": "acc_mBxKxAEUmVd6X",
        "status": "completed",
        "amount": 30000,
        "error": null,
        "created_at": "2024-03-28T15:25:44.763Z",
        "updated_at": "2024-03-28T15:26:04.082Z"
      },
      {...}
    ]
  }
  ```
</ResponseExample>


# The balances endpoint



export const get_common_parameters = (resource_name = 'resource') => {
  return {
    id: {
      name: 'id',
      type: "string",
      required: false,
      description: `Unique identifier for the ${resource_name}.`
    },
    entity_id: {
      name: 'entity_id',
      type: 'string',
      required: false,
      description: 'The ID of the associated Entity.'
    },
    account_id: {
      name: 'account_id',
      type: 'string',
      required: false,
      description: 'The ID of the associated Account.'
    },
    error: {
      name: 'error',
      type: 'object | null',
      required: false,
      description: <>
          An object representing an error that occurred while processing
          this {resource_name}. See <a href={`/reference/errors/${resource_name.replace(/^([A-Z])/, function (match) {
        return match.toLowerCase();
      }).replace(/([A-Z])/g, function (match) {
        return "-" + match.toLowerCase();
      })}-errors`}>{resource_name} errors</a>.
        </>
    },
    status_error: {
      name: 'status_error',
      type: 'object | null',
      required: false,
      description: <>
          An object representing an error that occurred while processing
          this {resource_name}. See <a href="/reference/errors/product-errors#status-errors">{resource_name} errors</a>.
        </>
    },
    metadata: {
      name: 'metadata',
      type: 'object | null',
      required: false,
      description: <>
          Additional data provided during creation.
          See <a href="/reference/metadata">metadata</a>
        </>
    },
    created_at: {
      name: 'created_at',
      type: 'string',
      required: false,
      description: `Timestamp of when the ${resource_name} was created.`
    },
    updated_at: {
      name: 'updated_at',
      type: 'string',
      required: false,
      description: `Timestamp of when the ${resource_name} was last updated.`
    },
    status: (enums = []) => ({
      name: 'status',
      type: 'enum',
      required: false,
      description: `Status of the ${resource_name}.`,
      enums
    }),
    type: (enums = []) => ({
      name: 'type',
      type: 'enum',
      required: false,
      description: `The type of ${resource_name}.`,
      enums
    })
  };
};

export const ParamList = ({items, is_child = false}) => {
  return items.map(item => {
    const field_props = {
      id: Math.random().toString(),
      body: item.name,
      name: item.name,
      type: item.type,
      required: item.required
    };
    const enums = item.enums || [];
    const items = item.items || [];
    const has_items = items?.length > 0;
    const has_enums = enums?.length > 0;
    const should_default_open = item.defaultOpen | false;
    const render_child_item = () => {
      const child_props = {
        title: has_enums ? "Possible enum values" : "properties"
      };
      if (should_default_open) child_props.defaultOpen = true;
      const has_inline_enums = has_enums && enums.every(enum_item => typeof enum_item === 'string') && enums.map((enum_item, idx) => {
        const is_last = idx === enums.length - 1;
        const is_2nd_to_last = idx === enums.length - 2;
        return <>
            <code>{enum_item}</code>
            {is_last && ''}
            {is_2nd_to_last && ' or '}
            {!is_last && !is_2nd_to_last && ', '}
          </>;
      });
      const enum_list = has_enums && !has_inline_enums && <Accordion {...child_props}>
          {enums.map(enum_item => <>
              <code>{enum_item.name}</code>
              <br />
              <p>{enum_item.description}</p>
            </>)}
        </Accordion>;
      const item_list = has_items && <Expandable {...child_props}>
          <ParamList items={items || []} is_child />
        </Expandable>;
      return <>
          <p>
            {item.description}
            {has_inline_enums && [has_inline_enums.length > 1 ? ' One of ' : ' Must be ', ...has_inline_enums]}
          </p>

          {enum_list}
          {item_list}
        </>;
    };
    return is_child ? <ResponseField {...field_props}>{render_child_item()}</ResponseField> : <ParamField {...field_props}>{render_child_item()}</ParamField>;
  });
};

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

**The Balance endpoint is available as a:**

| Type      | Use-Case                                                             |
| --------- | -------------------------------------------------------------------- |
| `Product` | On-Demand real-time balance from the Account’s financial institution |

## Balances Objects

<ParamList
  items={[
  (get_common_parameters('Balance').id),
  (get_common_parameters('Balance').account_id),
  (get_common_parameters('Balance').status([
  {
    name: 'pending',
    description: 'The real-time balance information sync is pending, and should automatically start soon.',
  },
  {
    name: 'in_progress',
    description: 'The real-time balance information sync is in progress.',
  },
  {
    name: 'completed',
    description: 'The balance information was successfully synced.',
  },
  {
    name: 'failed',
    description: 'The balance information failed to sync.',
  },
  ])),
  {
  name: 'amount',
  type: 'number',
  required: false,
  description: 'The balance amount.'
  },
  (get_common_parameters('Balance').error),
  (get_common_parameters('Balance').created_at),
  (get_common_parameters('Balance').updated_at),
  ]}
/>

## Webhook Payload

The [Webhook](/reference/webhooks/overview) payload will contain the following information:

```json
{
  "id": "string",
  "type": "balance.create" | "balance.update",
  "path": "/accounts/<acc_id>/balances/<bal_id>",
}
```

<RequestExample>
  ```json THE BALANCE OBJECT
  {
    "id": "bal_ebzh8KaR9HCBG",
    "account_id": "acc_mBxKxAEUmVd6X",
    "status": "completed",
    "amount": 30000,
    "error": null,
    "created_at": "2024-03-14T01:41:28.434Z",
    "updated_at": "2024-03-14T01:41:28.655Z"
  }
  ```
</RequestExample>


# Retrieve a Balance

GET /accounts/{acc_id}/balances/{bal_id}

export const ParamList = ({items, is_child = false}) => {
  return items.map(item => {
    const field_props = {
      id: Math.random().toString(),
      body: item.name,
      name: item.name,
      type: item.type,
      required: item.required
    };
    const enums = item.enums || [];
    const items = item.items || [];
    const has_items = items?.length > 0;
    const has_enums = enums?.length > 0;
    const should_default_open = item.defaultOpen | false;
    const render_child_item = () => {
      const child_props = {
        title: has_enums ? "Possible enum values" : "properties"
      };
      if (should_default_open) child_props.defaultOpen = true;
      const has_inline_enums = has_enums && enums.every(enum_item => typeof enum_item === 'string') && enums.map((enum_item, idx) => {
        const is_last = idx === enums.length - 1;
        const is_2nd_to_last = idx === enums.length - 2;
        return <>
            <code>{enum_item}</code>
            {is_last && ''}
            {is_2nd_to_last && ' or '}
            {!is_last && !is_2nd_to_last && ', '}
          </>;
      });
      const enum_list = has_enums && !has_inline_enums && <Accordion {...child_props}>
          {enums.map(enum_item => <>
              <code>{enum_item.name}</code>
              <br />
              <p>{enum_item.description}</p>
            </>)}
        </Accordion>;
      const item_list = has_items && <Expandable {...child_props}>
          <ParamList items={items || []} is_child />
        </Expandable>;
      return <>
          <p>
            {item.description}
            {has_inline_enums && [has_inline_enums.length > 1 ? ' One of ' : ' Must be ', ...has_inline_enums]}
          </p>

          {enum_list}
          {item_list}
        </>;
    };
    return is_child ? <ResponseField {...field_props}>{render_child_item()}</ResponseField> : <ParamField {...field_props}>{render_child_item()}</ParamField>;
  });
};

Retrieve a Balance record for an Account.

## Path Parameters

<ParamList
  items={[
  {
  name: 'acc_id',
  type: 'string',
  required: true,
  description: 'ID of the Account.',
  },
  {
  name: 'bal_id',
  type: 'string',
  required: true,
  description: 'ID of the Balance.',
  },
  ]}
/>

## Returns

Returns a Balance object.

<RequestExample>
  ```bash cURL
  curl https://production.methodfi.com/accounts/acc_yVf3mkzbhz9tj/balances/bal_ebzh8KaR9HCBG \
    -X GET \
    -H "Method-Version: 2024-04-04" \
    -H "Authorization: Bearer sk_WyZEWVfTcH7GqmPzUPk65Vjc"
  ```

  ```javascript Node.js
  const response = await method
    .accounts('acc_yVf3mkzbhz9tj')
    .balances
    .retrieve('bal_ebzh8KaR9HCBG');
  ```

  ```python Python
  response = method
    .accounts('acc_yVf3mkzbhz9tj')
    .balances
    .retrieve('bal_ebzh8KaR9HCBG')
  ```
</RequestExample>

<ResponseExample>
  ```json
  {
    "id": "bal_ebzh8KaR9HCBG",
    "account_id": "acc_mBxKxAEUmVd6X",
    "status": "completed",
    "amount": 30000,
    "error": null,
    "created_at": "2024-03-28T15:25:44.763Z",
    "updated_at": "2024-03-28T15:26:04.082Z"
  }
  ```
</ResponseExample>


# Create a Card Brand

POST /accounts/{acc_id}/card_brands

export const ParamList = ({items, is_child = false}) => {
  return items.map(item => {
    const field_props = {
      id: Math.random().toString(),
      body: item.name,
      name: item.name,
      type: item.type,
      required: item.required
    };
    const enums = item.enums || [];
    const items = item.items || [];
    const has_items = items?.length > 0;
    const has_enums = enums?.length > 0;
    const should_default_open = item.defaultOpen | false;
    const render_child_item = () => {
      const child_props = {
        title: has_enums ? "Possible enum values" : "properties"
      };
      if (should_default_open) child_props.defaultOpen = true;
      const has_inline_enums = has_enums && enums.every(enum_item => typeof enum_item === 'string') && enums.map((enum_item, idx) => {
        const is_last = idx === enums.length - 1;
        const is_2nd_to_last = idx === enums.length - 2;
        return <>
            <code>{enum_item}</code>
            {is_last && ''}
            {is_2nd_to_last && ' or '}
            {!is_last && !is_2nd_to_last && ', '}
          </>;
      });
      const enum_list = has_enums && !has_inline_enums && <Accordion {...child_props}>
          {enums.map(enum_item => <>
              <code>{enum_item.name}</code>
              <br />
              <p>{enum_item.description}</p>
            </>)}
        </Accordion>;
      const item_list = has_items && <Expandable {...child_props}>
          <ParamList items={items || []} is_child />
        </Expandable>;
      return <>
          <p>
            {item.description}
            {has_inline_enums && [has_inline_enums.length > 1 ? ' One of ' : ' Must be ', ...has_inline_enums]}
          </p>

          {enum_list}
          {item_list}
        </>;
    };
    return is_child ? <ResponseField {...field_props}>{render_child_item()}</ResponseField> : <ParamField {...field_props}>{render_child_item()}</ParamField>;
  });
};

Creates a new CardBrand request to retrieve the Account's card brand.

Operation Type: <Tooltip tip="Your request is processed immediately, and you'll receive a response before proceeding. Webhooks will be fired in parallel.">⚡ Synchronous</Tooltip>

## Path Parameters

<ParamList
  items={[
  {
  name: 'acc_id',
  type: 'string',
  required: true,
  description: 'ID of the Account.',
  },
  ]}
/>

## Returns

Returns a CardBrand object.

<RequestExample>
  ```bash cURL
  curl https://production.methodfi.com/accounts/acc_yVf3mkzbhz9tj/card_brands \
    -X POST \
    -H "Method-Version: 2024-04-04" \
    -H "Authorization: Bearer sk_WyZEWVfTcH7GqmPzUPk65Vjc"
  ```

  ```javascript Node.js
  const response = await method
    .accounts('acc_yVf3mkzbhz9tj')
    .cardBrands
    .create();
  ```

  ```python Python
  response = method
    .accounts('acc_yVf3mkzbhz9tj')
    .card_brands
    .create()
  ```
</RequestExample>

<ResponseExample>
  ```json
  {
    "id": "cbrd_eVMDNUPfrFk3e",
    "account_id": "acc_yVf3mkzbhz9tj",
    "network": "visa",
    "issuer": "Chase",
    "last4": "8623",
    "brands": [
      {
        "id": "brand_AMxtjQzAfDCRP",
        "name": "Chase Sapphire Reserve",
        "url": "https://static.methodfi.com/card_brands/1b7ccaba6535cb837f802d968add4700.png"
      }
    ],
    "status": "completed",
    "shared": false,
    "error": null,
    "created_at": "2024-03-19T01:05:37.247Z",
    "updated_at": "2024-03-19T01:05:37.247Z"
  }
  ```
</ResponseExample>


# List all Card Brands

GET /accounts/{acc_id}/card_brands

export const get_common_parameters = (resource_name = 'resource') => {
  return {
    id: {
      name: 'id',
      type: "string",
      required: false,
      description: `Unique identifier for the ${resource_name}.`
    },
    entity_id: {
      name: 'entity_id',
      type: 'string',
      required: false,
      description: 'The ID of the associated Entity.'
    },
    account_id: {
      name: 'account_id',
      type: 'string',
      required: false,
      description: 'The ID of the associated Account.'
    },
    error: {
      name: 'error',
      type: 'object | null',
      required: false,
      description: <>
          An object representing an error that occurred while processing
          this {resource_name}. See <a href={`/reference/errors/${resource_name.replace(/^([A-Z])/, function (match) {
        return match.toLowerCase();
      }).replace(/([A-Z])/g, function (match) {
        return "-" + match.toLowerCase();
      })}-errors`}>{resource_name} errors</a>.
        </>
    },
    status_error: {
      name: 'status_error',
      type: 'object | null',
      required: false,
      description: <>
          An object representing an error that occurred while processing
          this {resource_name}. See <a href="/reference/errors/product-errors#status-errors">{resource_name} errors</a>.
        </>
    },
    metadata: {
      name: 'metadata',
      type: 'object | null',
      required: false,
      description: <>
          Additional data provided during creation.
          See <a href="/reference/metadata">metadata</a>
        </>
    },
    created_at: {
      name: 'created_at',
      type: 'string',
      required: false,
      description: `Timestamp of when the ${resource_name} was created.`
    },
    updated_at: {
      name: 'updated_at',
      type: 'string',
      required: false,
      description: `Timestamp of when the ${resource_name} was last updated.`
    },
    status: (enums = []) => ({
      name: 'status',
      type: 'enum',
      required: false,
      description: `Status of the ${resource_name}.`,
      enums
    }),
    type: (enums = []) => ({
      name: 'type',
      type: 'enum',
      required: false,
      description: `The type of ${resource_name}.`,
      enums
    })
  };
};

export const get_pagination_defaults = (resource_name = 'records') => [{
  name: 'from_date',
  type: 'string',
  required: false,
  description: `ISO 8601 formatted date (YYYY-MM-DD) to filter for ${resource_name} created on and after the date provided.`
}, {
  name: 'to_date',
  type: 'string',
  required: false,
  description: `ISO 8601 formatted date (YYYY-MM-DD) to filter for ${resource_name} created on and before the date provided.`
}, {
  name: 'page',
  type: 'string',
  required: false,
  description: `The number of the page to return.`
}, {
  name: 'page_cursor',
  type: 'string',
  required: false,
  description: <>
        The ID of a resource from which a page should start or end. Mutually exclusive with <code>page</code>.
      </>
}, {
  name: 'page_limit',
  type: 'string',
  required: false,
  description: `The number of ${resource_name} to return per page.`
}];

export const ParamList = ({items, is_child = false}) => {
  return items.map(item => {
    const field_props = {
      id: Math.random().toString(),
      body: item.name,
      name: item.name,
      type: item.type,
      required: item.required
    };
    const enums = item.enums || [];
    const items = item.items || [];
    const has_items = items?.length > 0;
    const has_enums = enums?.length > 0;
    const should_default_open = item.defaultOpen | false;
    const render_child_item = () => {
      const child_props = {
        title: has_enums ? "Possible enum values" : "properties"
      };
      if (should_default_open) child_props.defaultOpen = true;
      const has_inline_enums = has_enums && enums.every(enum_item => typeof enum_item === 'string') && enums.map((enum_item, idx) => {
        const is_last = idx === enums.length - 1;
        const is_2nd_to_last = idx === enums.length - 2;
        return <>
            <code>{enum_item}</code>
            {is_last && ''}
            {is_2nd_to_last && ' or '}
            {!is_last && !is_2nd_to_last && ', '}
          </>;
      });
      const enum_list = has_enums && !has_inline_enums && <Accordion {...child_props}>
          {enums.map(enum_item => <>
              <code>{enum_item.name}</code>
              <br />
              <p>{enum_item.description}</p>
            </>)}
        </Accordion>;
      const item_list = has_items && <Expandable {...child_props}>
          <ParamList items={items || []} is_child />
        </Expandable>;
      return <>
          <p>
            {item.description}
            {has_inline_enums && [has_inline_enums.length > 1 ? ' One of ' : ' Must be ', ...has_inline_enums]}
          </p>

          {enum_list}
          {item_list}
        </>;
    };
    return is_child ? <ResponseField {...field_props}>{render_child_item()}</ResponseField> : <ParamField {...field_props}>{render_child_item()}</ParamField>;
  });
};

Retrieve a list of Card Brands' metadata for a specific Account.

## Path Parameters

<ParamList
  items={[
  {
  name: 'acc_id',
  type: 'string',
  required: true,
  description: 'ID of the Account.',
  }
  ]}
/>

## Query Parameters

<ParamList
  items={[
  ...get_pagination_defaults('Card Brands'),
  ]}
/>

## Returns

Returns a list of Card Brands.

<RequestExample>
  ```bash cURL
  curl "https://production.methodfi.com/acc_yVf3mkzbhz9tj/card_brands" \
    -H "Method-Version: 2024-04-04" \
    -H "Authorization: Bearer sk_WyZEWVfTcH7GqmPzUPk65Vjc"
  ```

  ```javascript Node.js
  const response = await method
    .accounts('acc_yVf3mkzbhz9tj')
    .card_brands
    .list();
  ```

  ```python Python
  response = method
    .accounts('acc_yVf3mkzbhz9tj')
    .card_brands
    .list()
  ```
</RequestExample>

<ResponseExample>
  ```json
  {
    "success": true,
    "data": [
      {
        "id": "cbrd_BDpzdie35Ldkm",
        "account_id": "acc_yVf3mkzbhz9tj",
        "network": "visa",
        "status": "completed",
        "issuer": "Wells Fargo",
        "last4": "1234",
        "brands": [
            {
                "art_id": "art_Yvd3922dfalja",
                "url": "https://static.methodfi.com/card_brands/f5a54867fb8fab076c2d36216ea2ca60.png",
                "id": "brand_cms12dmfnDSJ3",
                "name": "Wells Fargo Cash Wise"
            },
            {
                "art_id": "art_22dfaljaYvd39",
                "url": "https://static.methodfi.com/card_brands/c8fbea81f8aafca9b475cff3172c0bd4.png",
                "id": "brand_anDwro12EUHe4",
                "name": "Wells Fargo Autograph"
            },
            {
                "art_id": "art_2a2ljcmozdxdd",
                "url": "https://static.methodfi.com/card_brands/f5a54867fb8fa8aafca9b475cff3172a8.png",
                "id": "brand_38ShenxSulqjs",
                "name": "Wells Fargo Active Cash"
            }
        ],
        "shared": true,
        "error": null,
        "created_at": "2024-11-06T20:43:38.820Z",
        "updated_at": "2024-11-06T20:43:38.820Z"
      },
      {...}
    ],
    "message": null
  }
  ```
</ResponseExample>


# The card brand endpoint



export const get_common_parameters = (resource_name = 'resource') => {
  return {
    id: {
      name: 'id',
      type: "string",
      required: false,
      description: `Unique identifier for the ${resource_name}.`
    },
    entity_id: {
      name: 'entity_id',
      type: 'string',
      required: false,
      description: 'The ID of the associated Entity.'
    },
    account_id: {
      name: 'account_id',
      type: 'string',
      required: false,
      description: 'The ID of the associated Account.'
    },
    error: {
      name: 'error',
      type: 'object | null',
      required: false,
      description: <>
          An object representing an error that occurred while processing
          this {resource_name}. See <a href={`/reference/errors/${resource_name.replace(/^([A-Z])/, function (match) {
        return match.toLowerCase();
      }).replace(/([A-Z])/g, function (match) {
        return "-" + match.toLowerCase();
      })}-errors`}>{resource_name} errors</a>.
        </>
    },
    status_error: {
      name: 'status_error',
      type: 'object | null',
      required: false,
      description: <>
          An object representing an error that occurred while processing
          this {resource_name}. See <a href="/reference/errors/product-errors#status-errors">{resource_name} errors</a>.
        </>
    },
    metadata: {
      name: 'metadata',
      type: 'object | null',
      required: false,
      description: <>
          Additional data provided during creation.
          See <a href="/reference/metadata">metadata</a>
        </>
    },
    created_at: {
      name: 'created_at',
      type: 'string',
      required: false,
      description: `Timestamp of when the ${resource_name} was created.`
    },
    updated_at: {
      name: 'updated_at',
      type: 'string',
      required: false,
      description: `Timestamp of when the ${resource_name} was last updated.`
    },
    status: (enums = []) => ({
      name: 'status',
      type: 'enum',
      required: false,
      description: `Status of the ${resource_name}.`,
      enums
    }),
    type: (enums = []) => ({
      name: 'type',
      type: 'enum',
      required: false,
      description: `The type of ${resource_name}.`,
      enums
    })
  };
};

export const ParamList = ({items, is_child = false}) => {
  return items.map(item => {
    const field_props = {
      id: Math.random().toString(),
      body: item.name,
      name: item.name,
      type: item.type,
      required: item.required
    };
    const enums = item.enums || [];
    const items = item.items || [];
    const has_items = items?.length > 0;
    const has_enums = enums?.length > 0;
    const should_default_open = item.defaultOpen | false;
    const render_child_item = () => {
      const child_props = {
        title: has_enums ? "Possible enum values" : "properties"
      };
      if (should_default_open) child_props.defaultOpen = true;
      const has_inline_enums = has_enums && enums.every(enum_item => typeof enum_item === 'string') && enums.map((enum_item, idx) => {
        const is_last = idx === enums.length - 1;
        const is_2nd_to_last = idx === enums.length - 2;
        return <>
            <code>{enum_item}</code>
            {is_last && ''}
            {is_2nd_to_last && ' or '}
            {!is_last && !is_2nd_to_last && ', '}
          </>;
      });
      const enum_list = has_enums && !has_inline_enums && <Accordion {...child_props}>
          {enums.map(enum_item => <>
              <code>{enum_item.name}</code>
              <br />
              <p>{enum_item.description}</p>
            </>)}
        </Accordion>;
      const item_list = has_items && <Expandable {...child_props}>
          <ParamList items={items || []} is_child />
        </Expandable>;
      return <>
          <p>
            {item.description}
            {has_inline_enums && [has_inline_enums.length > 1 ? ' One of ' : ' Must be ', ...has_inline_enums]}
          </p>

          {enum_list}
          {item_list}
        </>;
    };
    return is_child ? <ResponseField {...field_props}>{render_child_item()}</ResponseField> : <ParamField {...field_props}>{render_child_item()}</ParamField>;
  });
};

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

<Info>
  CardBrand is only available for <code>visa</code> and <code>mastercard</code> credit
  cards.
</Info>

**The CardBrand endpoint is available as a:**

| Type      | Use-Case                                                                                                   |
| --------- | ---------------------------------------------------------------------------------------------------------- |
| `Product` | On-Demand retrieval of credit card metadata (Product / Brand Name, Art, etc) directly from the card issuer |

## CardBrand Objects

<ParamList
  items={[
  (get_common_parameters('CardBrand').id),
  (get_common_parameters('CardBrand').account_id),
  {
  name: 'network',
  type: 'enum',
  required: false,
  description: 'The credit card network.',
  enums: ['visa', 'mastercard'],
  },
  {
  name: 'issuer',
  type: 'string',
  required: false,
  description: 'The credit card issuer.',
  },
  {
  name: 'last4',
  type: 'string',
  required: false,
  description: 'The last 4 digits of the card account number.',
  },
  {
  name: 'brands',
  type: 'object[]',
  required: false,
  description: 'The brands associated with the card.',
  items: [
    {
      name: 'brands.id',
      type: 'string',
      required: false,
      description: (
        <>
          An ID that uniquely identifying the card's
          brand (ex. <code>brand_AMxtjQzAfDCRP</code> identifies <strong>Chase Sapphire Reserve</strong>).
        </>
      ),
    },
    {
      name: 'brands.url',
      type: 'string',
      required: false,
      description: 'The URL of the card art.',
    },
    {
      name: 'brands.name',
      type: 'string',
      required: false,
      description: 'The brand name of the card.',
    }
  ],
  },
  {
  name: 'shared',
  type: 'boolean',
  required: false,
  description: (
  <>
    If <code>true</code>, Method requires additional verification (AccountVerificationSession of type <code>pre_auth</code>)
    to return the definite brand for an Account, and multiple brands might be returned.
    {"\r \r"}
    If <code>false</code>, all verification requirements have been completed, and the brand has been returned by the issuer.
  </>)
  },
  {
  name: 'status',
  type: 'enum',
  required: false,
  description: 'status of the CardBrand.',
  enums: [
    {
      name: 'completed',
      description: 'The CardBrand request successfully completed.',
    },
    {
      name: 'failed',
      description: (<>
          The CardBrand request failed to complete. See{" "}
          <code>error</code> field.
      </>
      )
    },
  ],
  },
  (get_common_parameters('CardBrand').error),
  (get_common_parameters('CardBrand').created_at),
  (get_common_parameters('CardBrand').updated_at),
  ]}
/>

## Webhook Payload

The [Webhook](/reference/webhooks/overview) payload will contain the following information:

```json
{
  "id": "string",
  "type": "card_brand.create" | "card_brand.update",
  "path": "/accounts/<acc_id>/card_brands/<cbrd_id>",
}
```

<RequestExample>
  ```json THE CARD BRAND OBJECT
  {
    "id": "cbrd_eVMDNUPfrFk3e",
    "account_id": "acc_yVf3mkzbhz9tj",
    "network": "visa",
    "issuer": "Chase",
    "last4": "8623",
    "brands": [
      {
        "id": "brand_AMxtjQzAfDCRP",
        "name": "Chase Sapphire Reserve",
        "url": "https://static.methodfi.com/card_brands/1b7ccaba6535cb837f802d968add4700.png"
      }
    ],
    "status": "completed",
    "shared": false,
    "error": null,
    "created_at": "2024-03-19T01:05:37.247Z",
    "updated_at": "2024-03-19T01:05:37.247Z"
  }
  ```
</RequestExample>


# Retrieve a Card Brand

GET /accounts/{acc_id}/card_brands/{cbrd_id}

export const ParamList = ({items, is_child = false}) => {
  return items.map(item => {
    const field_props = {
      id: Math.random().toString(),
      body: item.name,
      name: item.name,
      type: item.type,
      required: item.required
    };
    const enums = item.enums || [];
    const items = item.items || [];
    const has_items = items?.length > 0;
    const has_enums = enums?.length > 0;
    const should_default_open = item.defaultOpen | false;
    const render_child_item = () => {
      const child_props = {
        title: has_enums ? "Possible enum values" : "properties"
      };
      if (should_default_open) child_props.defaultOpen = true;
      const has_inline_enums = has_enums && enums.every(enum_item => typeof enum_item === 'string') && enums.map((enum_item, idx) => {
        const is_last = idx === enums.length - 1;
        const is_2nd_to_last = idx === enums.length - 2;
        return <>
            <code>{enum_item}</code>
            {is_last && ''}
            {is_2nd_to_last && ' or '}
            {!is_last && !is_2nd_to_last && ', '}
          </>;
      });
      const enum_list = has_enums && !has_inline_enums && <Accordion {...child_props}>
          {enums.map(enum_item => <>
              <code>{enum_item.name}</code>
              <br />
              <p>{enum_item.description}</p>
            </>)}
        </Accordion>;
      const item_list = has_items && <Expandable {...child_props}>
          <ParamList items={items || []} is_child />
        </Expandable>;
      return <>
          <p>
            {item.description}
            {has_inline_enums && [has_inline_enums.length > 1 ? ' One of ' : ' Must be ', ...has_inline_enums]}
          </p>

          {enum_list}
          {item_list}
        </>;
    };
    return is_child ? <ResponseField {...field_props}>{render_child_item()}</ResponseField> : <ParamField {...field_props}>{render_child_item()}</ParamField>;
  });
};

Retrieves a CardBrand record for an Account.

## Path Parameters

<ParamList
  items={[
  {
  name: 'acc_id',
  type: 'string',
  required: true,
  description: 'ID of the Account.',
  },
  {
  name: 'cbrd_id',
  type: 'string',
  required: true,
  description: 'ID of the CardBrand.',
  },
  ]}
/>

## Returns

Returns a CardBrand object.

<RequestExample>
  ```bash cURL
  curl https://production.methodfi.com/accounts/acc_yVf3mkzbhz9tj/card_brands/cbrd_eVMDNUPfrFk3e \
    -X GET \
    -H "Method-Version: 2024-04-04" \
    -H "Authorization: Bearer sk_WyZEWVfTcH7GqmPzUPk65Vjc"
  ```

  ```javascript Node.js
  const response = await method
    .accounts('acc_yVf3mkzbhz9tj')
    .cardBrands
    .retrieve('cbrd_eVMDNUPfrFk3e');
  ```

  ```python Python
  response = method
    .accounts('acc_yVf3mkzbhz9tj')
    .card_brands
    .retrieve('cbrd_eVMDNUPfrFk3e')
  ```
</RequestExample>

<ResponseExample>
  ```json
  {
    "id": "cbrd_eVMDNUPfrFk3e",
    "account_id": "acc_yVf3mkzbhz9tj",
    "network": "visa",
    "issuer": "Chase",
    "last4": "8623",
    "brands": [
      {
        "id": "brand_AMxtjQzAfDCRP",
        "name": "Chase Sapphire Reserve",
        "url": "https://static.methodfi.com/card_brands/1b7ccaba6535cb837f802d968add4700.png"
      }
    ],
    "status": "completed",
    "shared": false,
    "error": null,
    "created_at": "2024-03-19T01:05:37.247Z",
    "updated_at": "2024-03-19T01:05:37.247Z"
  }
  ```
</ResponseExample>


# Withdraw an Account's Consent

POST /accounts/{acc_id}/consent

export const ParamList = ({items, is_child = false}) => {
  return items.map(item => {
    const field_props = {
      id: Math.random().toString(),
      body: item.name,
      name: item.name,
      type: item.type,
      required: item.required
    };
    const enums = item.enums || [];
    const items = item.items || [];
    const has_items = items?.length > 0;
    const has_enums = enums?.length > 0;
    const should_default_open = item.defaultOpen | false;
    const render_child_item = () => {
      const child_props = {
        title: has_enums ? "Possible enum values" : "properties"
      };
      if (should_default_open) child_props.defaultOpen = true;
      const has_inline_enums = has_enums && enums.every(enum_item => typeof enum_item === 'string') && enums.map((enum_item, idx) => {
        const is_last = idx === enums.length - 1;
        const is_2nd_to_last = idx === enums.length - 2;
        return <>
            <code>{enum_item}</code>
            {is_last && ''}
            {is_2nd_to_last && ' or '}
            {!is_last && !is_2nd_to_last && ', '}
          </>;
      });
      const enum_list = has_enums && !has_inline_enums && <Accordion {...child_props}>
          {enums.map(enum_item => <>
              <code>{enum_item.name}</code>
              <br />
              <p>{enum_item.description}</p>
            </>)}
        </Accordion>;
      const item_list = has_items && <Expandable {...child_props}>
          <ParamList items={items || []} is_child />
        </Expandable>;
      return <>
          <p>
            {item.description}
            {has_inline_enums && [has_inline_enums.length > 1 ? ' One of ' : ' Must be ', ...has_inline_enums]}
          </p>

          {enum_list}
          {item_list}
        </>;
    };
    return is_child ? <ResponseField {...field_props}>{render_child_item()}</ResponseField> : <ParamField {...field_props}>{render_child_item()}</ParamField>;
  });
};

Withdraws an Account's consent. This endpoint deletes information
on the account, sets its status to `disabled`, and removes all active Products or Subscriptions for the account.

## Path Parameters

<ParamList
  items={[
  {
  name: 'acc_id',
  type: 'string',
  required: true,
  description: 'ID of the Account.',
  },
  ]}
/>

## Body

<ParamList
  items={[
  {
  name: 'type',
  type: 'enum',
  required: true,
  description: (
    <>
      Available types: <code>withdraw</code>.
    </>
  ),
  },
  {
  name: 'reason',
  type: 'string',
  required: true,
  description: (
    <>
      Available Reasons: <code>holder_withdrew_consent</code>.
    </>
  ),
  }
  ]}
/>

## Returns

Returns the Account with `status` set to `disabled`.

<RequestExample>
  ```bash cURL
  curl https://production.methodfi.com/accounts/acc_yVf3mkzbhz9tj/consent \
    -X POST \
    -H "Method-Version: 2024-04-04" \
    -H "Authorization: Bearer sk_WyZEWVfTcH7GqmPzUPk65Vjc" \
    -H "Content-Type: application/json" \
    -d '{
      "type": "withdraw",
      "reason": "holder_withdrew_consent"
  }'
  ```

  ```javascript Node.js
  const account = await method.accounts.withdrawConsent('acc_yVf3mkzbhz9tj');
  ```

  ```python Python
  account = method.accounts.withdraw_consent('acc_yVf3mkzbhz9tj', {
    'type': 'withdraw',
    'reason': 'holder_withdrew_consent'
  })
  ```
</RequestExample>

<ResponseExample>
  ```json
  {
    "id": "acc_JmfdTzg9hp3QQ",
    "holder_id": "ent_4hBGhBAmgBDWt",
    "status": "disabled",
    "type": null,
    "ach": null,
    "liability": null,
    "capabilities": [],
    "available_capabilities": [],
    "error": {
      "type": "ACCOUNT_DISABLED",
      "sub_type": "ACCOUNT_CONSENT_WITHDRAWN",
      "code": 11004,
      "message": "Account was disabled due to consent withdrawal."
    },
    "metadata": null,
    "created_at": "2024-04-01T18:48:39.634Z",
    "updated_at": "2024-04-01T18:48:39.695Z"
  }
  ```
</ResponseExample>


# Create an Account

POST /accounts

export const ParamList = ({items, is_child = false}) => {
  return items.map(item => {
    const field_props = {
      id: Math.random().toString(),
      body: item.name,
      name: item.name,
      type: item.type,
      required: item.required
    };
    const enums = item.enums || [];
    const items = item.items || [];
    const has_items = items?.length > 0;
    const has_enums = enums?.length > 0;
    const should_default_open = item.defaultOpen | false;
    const render_child_item = () => {
      const child_props = {
        title: has_enums ? "Possible enum values" : "properties"
      };
      if (should_default_open) child_props.defaultOpen = true;
      const has_inline_enums = has_enums && enums.every(enum_item => typeof enum_item === 'string') && enums.map((enum_item, idx) => {
        const is_last = idx === enums.length - 1;
        const is_2nd_to_last = idx === enums.length - 2;
        return <>
            <code>{enum_item}</code>
            {is_last && ''}
            {is_2nd_to_last && ' or '}
            {!is_last && !is_2nd_to_last && ', '}
          </>;
      });
      const enum_list = has_enums && !has_inline_enums && <Accordion {...child_props}>
          {enums.map(enum_item => <>
              <code>{enum_item.name}</code>
              <br />
              <p>{enum_item.description}</p>
            </>)}
        </Accordion>;
      const item_list = has_items && <Expandable {...child_props}>
          <ParamList items={items || []} is_child />
        </Expandable>;
      return <>
          <p>
            {item.description}
            {has_inline_enums && [has_inline_enums.length > 1 ? ' One of ' : ' Must be ', ...has_inline_enums]}
          </p>

          {enum_list}
          {item_list}
        </>;
    };
    return is_child ? <ResponseField {...field_props}>{render_child_item()}</ResponseField> : <ParamField {...field_props}>{render_child_item()}</ParamField>;
  });
};

Creates a new Account for an Entity, either `ach` or `liability`, based on
the parameters provided. An account is a unique
representation of an [ACH](/reference/accounts/overview#ach)
or [Liability](/reference/accounts/overview#liability) account.

<Warning>
  Creating Liability Accounts directly is only supported on a case-by-case basis.
  If you need to create a Liability Account, contact your Method CSM.
</Warning>

## Body

<ParamList
  items={[
  {
  name: 'holder_id',
  type: 'string',
  required: true,
  description: 'ID of the Entity who is the legal holder of the Account.',
  },
  {
  name: 'ach',
  type: 'object',
  required: true,
  description: 'ACH account information.',
  items: [
    {
      name: 'ach.type',
      type: 'enum',
      required: true,
      description: 'The type of ACH Account.',
      enums: ['checking', 'savings'],
    },
    {
      name: 'ach.routing',
      type: 'string',
      required: true,
      description: 'ABA routing number of the ACH account. (maximum of 9 characters)',
    },
    {
      name: 'ach.number',
      type: 'string',
      required: true,
      description: 'Account number of the ACH account. (maximum of 17 characters).',
    },
  ],
  },
  ]}
/>

## Returns

Returns an Account object.

<RequestExample>
  ```bash cURL
  curl https://production.methodfi.com/accounts \
    -X POST \
    -H "Method-Version: 2024-04-04" \
    -H "Authorization: Bearer sk_WyZEWVfTcH7GqmPzUPk65Vjc" \
    -H "Content-Type: application/json" \
    -d '{
      "holder_id": "ent_y1a9e1fbnJ1f3",
      "ach": {
        "routing": "367537407",
        "number": "57838927",
        "type": "checking"
      }
    }'
  ```

  ```javascript Node.js
  const account = await method
    .accounts
    .create({
      holder_id: 'ent_y1a9e1fbnJ1f3',
      ach: {
        routing: '367537407',
        number: '57838927',
        type: 'checking',
      },
    });
  ```

  ```python Python
  account = method
    .accounts
    .create({
      'holder_id': 'ent_y1a9e1fbnJ1f3',
      'ach': {
        'routing': '367537407',
        'number': '57838927',
        'type': 'checking'
      }
    })
  ```
</RequestExample>

<ResponseExample>
  ```json
  {
    "id": "acc_BcRdHNjb9TYKV",
    "holder_id": "ent_wUzi83DJdx99e",
    "status": "active",
    "type": "ach",
    "ach": {
      "routing": "367537407",
      "number": "57838927",
      "type": "checking"
    },
    "latest_verification_session": "avf_7WGUjnFLcipRm",
    "products": [
      "payment"
    ],
    "restricted_products": [],
    "error": null,
    "metadata": null,
    "created_at": "2023-10-23T06:25:56.500Z",
    "updated_at": "2023-10-23T06:25:56.500Z"
  }
  ```
</ResponseExample>


# List all Accounts

GET /accounts

export const ExpandableFieldsQueryParams = (resource_type = 'all') => {
  const entity = [{
    name: 'connect',
    description: <>This is an <a href="/reference/entities/overview">Entity</a> property, and refers to the <a href="/reference/entities/connect/overview#connect-objects">Connect Object</a>.</>
  }, {
    name: 'credit_score',
    description: <>This is an <a href="/reference/entities/overview">Entity</a> property, and refers to the <a href="/reference/entities/credit-scores/overview#creditscore-objects">CreditScore Object</a>.</>
  }, {
    name: 'attribute',
    description: <>This is an <a href="/reference/entities/overview">Entity</a> property, and refers to the <a href="/reference/entities/attributes/overview#attribute-objects">Attribute Object</a>.</>
  }, {
    name: 'identity_latest_verification_session',
    description: <>This is an <a href="/reference/entities/overview">Entity</a> property, and refers to the <a href="/reference/entities/verification-sessions/overview#entity-verification-session-objects">EntityVerificationSession Object</a>.</>
  }, {
    name: 'phone_latest_verification_session',
    description: <>This is an <a href="/reference/entities/overview">Entity</a> property, and refers to the <a href="/reference/entities/verification-sessions/overview#entity-verification-session-objects">EntityVerificationSession Object</a>.</>
  }];
  const account = [{
    name: 'sensitive',
    description: <>This is an <a href="/reference/accounts/overview">Account</a> property, and refers to the <a href="/reference/accounts/sensitive/overview#sensitive-objects">Sensitive Object</a>.</>
  }, {
    name: 'balance',
    description: <>This is an <a href="/reference/accounts/overview">Account</a> property, and refers to the <a href="/reference/accounts/balances/overview#balances-objects">Balance Object</a>.</>
  }, {
    name: 'card_brand',
    description: <>This is an <a href="/reference/accounts/overview">Account</a> property, and refers to the <a href="/reference/accounts/card-brands/overview#cardbrand-objects">CardBrand Object</a>.</>
  }, {
    name: 'payoff',
    description: <>This is an <a href="/reference/accounts/overview">Account</a> property, and refers to the <a href="/reference/accounts/payoffs/overview#payoff-objects">Payoff Object</a>.</>
  }, {
    name: 'transactions',
    description: <>This is an <a href="/reference/accounts/overview">Account</a> property, and refers to the <a href="/reference/accounts/transactions/overview#transaction-objects">Transaction Object</a>.</>
  }, {
    name: 'update',
    description: <>This is an <a href="/reference/accounts/overview">Account</a> property, and refers to the <a href="/reference/accounts/updates/overview#update-objects">Update Object</a>.</>
  }, {
    name: 'latest_verification_session',
    description: <>This is an <a href="/reference/accounts/overview">Account</a> property, and refers to the <a href="/reference/accounts/verification-sessions/overview#accountverificationsession-objects">AccountVerificationSession Object</a>.</>
  }];
  const ExpandableFieldsByResourceType = {
    entity,
    account,
    all: Array.from(new Set([...entity, ...account]))
  };
  return {
    name: "expand",
    type: "enum[]",
    description: <>
        Attributes that can be expanded into an object to
        provide additional information.
      </>,
    enums: [...ExpandableFieldsByResourceType[resource_type].map(expandable_field => ({
      ...expandable_field
    }))]
  };
};

export const get_common_parameters = (resource_name = 'resource') => {
  return {
    id: {
      name: 'id',
      type: "string",
      required: false,
      description: `Unique identifier for the ${resource_name}.`
    },
    entity_id: {
      name: 'entity_id',
      type: 'string',
      required: false,
      description: 'The ID of the associated Entity.'
    },
    account_id: {
      name: 'account_id',
      type: 'string',
      required: false,
      description: 'The ID of the associated Account.'
    },
    error: {
      name: 'error',
      type: 'object | null',
      required: false,
      description: <>
          An object representing an error that occurred while processing
          this {resource_name}. See <a href={`/reference/errors/${resource_name.replace(/^([A-Z])/, function (match) {
        return match.toLowerCase();
      }).replace(/([A-Z])/g, function (match) {
        return "-" + match.toLowerCase();
      })}-errors`}>{resource_name} errors</a>.
        </>
    },
    status_error: {
      name: 'status_error',
      type: 'object | null',
      required: false,
      description: <>
          An object representing an error that occurred while processing
          this {resource_name}. See <a href="/reference/errors/product-errors#status-errors">{resource_name} errors</a>.
        </>
    },
    metadata: {
      name: 'metadata',
      type: 'object | null',
      required: false,
      description: <>
          Additional data provided during creation.
          See <a href="/reference/metadata">metadata</a>
        </>
    },
    created_at: {
      name: 'created_at',
      type: 'string',
      required: false,
      description: `Timestamp of when the ${resource_name} was created.`
    },
    updated_at: {
      name: 'updated_at',
      type: 'string',
      required: false,
      description: `Timestamp of when the ${resource_name} was last updated.`
    },
    status: (enums = []) => ({
      name: 'status',
      type: 'enum',
      required: false,
      description: `Status of the ${resource_name}.`,
      enums
    }),
    type: (enums = []) => ({
      name: 'type',
      type: 'enum',
      required: false,
      description: `The type of ${resource_name}.`,
      enums
    })
  };
};

export const get_pagination_defaults = (resource_name = 'records') => [{
  name: 'from_date',
  type: 'string',
  required: false,
  description: `ISO 8601 formatted date (YYYY-MM-DD) to filter for ${resource_name} created on and after the date provided.`
}, {
  name: 'to_date',
  type: 'string',
  required: false,
  description: `ISO 8601 formatted date (YYYY-MM-DD) to filter for ${resource_name} created on and before the date provided.`
}, {
  name: 'page',
  type: 'string',
  required: false,
  description: `The number of the page to return.`
}, {
  name: 'page_cursor',
  type: 'string',
  required: false,
  description: <>
        The ID of a resource from which a page should start or end. Mutually exclusive with <code>page</code>.
      </>
}, {
  name: 'page_limit',
  type: 'string',
  required: false,
  description: `The number of ${resource_name} to return per page.`
}];

export const ParamList = ({items, is_child = false}) => {
  return items.map(item => {
    const field_props = {
      id: Math.random().toString(),
      body: item.name,
      name: item.name,
      type: item.type,
      required: item.required
    };
    const enums = item.enums || [];
    const items = item.items || [];
    const has_items = items?.length > 0;
    const has_enums = enums?.length > 0;
    const should_default_open = item.defaultOpen | false;
    const render_child_item = () => {
      const child_props = {
        title: has_enums ? "Possible enum values" : "properties"
      };
      if (should_default_open) child_props.defaultOpen = true;
      const has_inline_enums = has_enums && enums.every(enum_item => typeof enum_item === 'string') && enums.map((enum_item, idx) => {
        const is_last = idx === enums.length - 1;
        const is_2nd_to_last = idx === enums.length - 2;
        return <>
            <code>{enum_item}</code>
            {is_last && ''}
            {is_2nd_to_last && ' or '}
            {!is_last && !is_2nd_to_last && ', '}
          </>;
      });
      const enum_list = has_enums && !has_inline_enums && <Accordion {...child_props}>
          {enums.map(enum_item => <>
              <code>{enum_item.name}</code>
              <br />
              <p>{enum_item.description}</p>
            </>)}
        </Accordion>;
      const item_list = has_items && <Expandable {...child_props}>
          <ParamList items={items || []} is_child />
        </Expandable>;
      return <>
          <p>
            {item.description}
            {has_inline_enums && [has_inline_enums.length > 1 ? ' One of ' : ' Must be ', ...has_inline_enums]}
          </p>

          {enum_list}
          {item_list}
        </>;
    };
    return is_child ? <ResponseField {...field_props}>{render_child_item()}</ResponseField> : <ParamField {...field_props}>{render_child_item()}</ParamField>;
  });
};

Returns a list of Accounts.

## Query Parameters

<ParamList
  items={[
  {
  name: 'holder_id',
  type: 'string',
  required: false,
  description: 'The ID of the Entity whose Accounts to retrieve.',
  },
  get_common_parameters('Account').status([
  { name: 'active', description: 'The Account is open and is in a usable state.' },
  {
    name: 'disabled',
    description: (
      <>
        The Account has been disabled and is no longer usable. Check
        the account's <code>error</code> property for more information.
      </>
    ),
  },
  { name: 'closed', description: 'The Account has been closed, and is either fully paid-off or no longer exists.' },
  ]),
  get_common_parameters('Account').type([
  { name: 'ach', description: 'A bank account (Checking or Savings).' },
  { name: 'liability', description: 'A debt-type account (Credit Card, Mortgage, etc).' },
  ]),
  {
  name: 'liability.mch_id',
  type: 'string',
  description: 'The ID of the Merchant to which a liability Account is linked.',
  },
  {
  name: 'liability.type',
  type: 'enum',
  description: (
    <>
      The type of the liability Account to
      retrieve. See <a href="/reference/accounts/overview#account-liability-types">Account Liability Types.</a>
    </>
  ),
  },
  {
  name: 'liability.ownership',
  type: 'enum',
  description: 'The holder\'s ownership type relative to the Account.',
  enums: ['primary', 'authorized', 'joint', 'unknown'],
  },
  ...get_pagination_defaults('Accounts'),
  ExpandableFieldsQueryParams('account'),
  ]}
/>

## Returns

Returns a list of Accounts.

<RequestExample>
  ```bash cURL
  curl "https://production.methodfi.com/accounts?holder_id=ent_y1a9e1fbnJ1f3&type=liability&status=active" \
    -H "Method-Version: 2024-04-04" \
    -H "Authorization: Bearer sk_WyZEWVfTcH7GqmPzUPk65Vjc"
  ```

  ```javascript Node.js
  const accounts = await method
    .accounts
    .list({
      holder_id: 'ent_y1a9e1fbnJ1f3',
      type: 'liability',
      status: 'active',
    });
  ```

  ```python Python
  accounts = method
    .accounts
    .list({
      'holder_id': 'ent_y1a9e1fbnJ1f3',
      'type': 'liability',
      'status': 'active'
    })
  ```
</RequestExample>

<ResponseExample>
  ```json
  {
    "data": [
      {
        "id": "acc_RGACQH7XdfYhC",
        "holder_id": "ent_y1a9e1fbnJ1f3",
        "status": "active",
        "type": "liability",
        "liability": {
          "mch_id": "mch_302086",
          "mask": "1580",
          "ownership": "primary",
          "fingerprint": "27d5c0ea28338619192076d150eb7b56c288f9a1",
          "type": "credit_card",
          "name": "Chase Sapphire Reserve Credit Card"
        },
        "latest_verification_session": "avf_tB9mpmew8FLit",
        "update": "upt_TXDTR7Amyz7Az",
        "balance": "bal_dGCCNWHMQYRay",
        "card_brand": "crd_eVMDNUPfrFk3e",
        "products": ["balance", "card_brand", "update", "payment"],
        "restricted_products": ["sensitive"],
        "subscriptions": [],
        "available_subscriptions": ["update.snapshot", "update"],
        "restricted_subscriptions": ["transactions"],
        "error": null,
        "metadata": null,
        "created_at": "2024-04-12T18:57:57.857Z",
        "updated_at": "2024-04-12T18:57:58.430Z",
      }
    ]
  }
  ```
</ResponseExample>


# The account endpoint



export const get_common_parameters = (resource_name = 'resource') => {
  return {
    id: {
      name: 'id',
      type: "string",
      required: false,
      description: `Unique identifier for the ${resource_name}.`
    },
    entity_id: {
      name: 'entity_id',
      type: 'string',
      required: false,
      description: 'The ID of the associated Entity.'
    },
    account_id: {
      name: 'account_id',
      type: 'string',
      required: false,
      description: 'The ID of the associated Account.'
    },
    error: {
      name: 'error',
      type: 'object | null',
      required: false,
      description: <>
          An object representing an error that occurred while processing
          this {resource_name}. See <a href={`/reference/errors/${resource_name.replace(/^([A-Z])/, function (match) {
        return match.toLowerCase();
      }).replace(/([A-Z])/g, function (match) {
        return "-" + match.toLowerCase();
      })}-errors`}>{resource_name} errors</a>.
        </>
    },
    status_error: {
      name: 'status_error',
      type: 'object | null',
      required: false,
      description: <>
          An object representing an error that occurred while processing
          this {resource_name}. See <a href="/reference/errors/product-errors#status-errors">{resource_name} errors</a>.
        </>
    },
    metadata: {
      name: 'metadata',
      type: 'object | null',
      required: false,
      description: <>
          Additional data provided during creation.
          See <a href="/reference/metadata">metadata</a>
        </>
    },
    created_at: {
      name: 'created_at',
      type: 'string',
      required: false,
      description: `Timestamp of when the ${resource_name} was created.`
    },
    updated_at: {
      name: 'updated_at',
      type: 'string',
      required: false,
      description: `Timestamp of when the ${resource_name} was last updated.`
    },
    status: (enums = []) => ({
      name: 'status',
      type: 'enum',
      required: false,
      description: `Status of the ${resource_name}.`,
      enums
    }),
    type: (enums = []) => ({
      name: 'type',
      type: 'enum',
      required: false,
      description: `The type of ${resource_name}.`,
      enums
    })
  };
};

export const get_expandable_field = field => {
  const ExpandableFieldsNameToValues = {
    connect: {
      key_name: 'connect',
      object_name: 'Connect'
    },
    credit_score: {
      key_name: 'credit_score',
      object_name: 'CreditScore'
    },
    sensitive: {
      key_name: 'sensitive',
      object_name: 'Sensitive'
    },
    balance: {
      key_name: 'balance',
      object_name: 'Balance'
    },
    card_brand: {
      key_name: 'card_brand',
      object_name: 'CardBrand'
    },
    payoff: {
      key_name: 'payoff',
      object_name: 'Payoff'
    },
    transactions: {
      key_name: 'transactions',
      object_name: 'Transaction'
    },
    update: {
      key_name: 'update',
      object_name: 'Update'
    },
    latest_verification_session: {
      key_name: 'latest_verification_session',
      object_name: 'AccountVerificationSession'
    }
  };
  const name = ExpandableFieldsNameToValues[field].key_name;
  const object_name = ExpandableFieldsNameToValues[field].object_name;
  return {
    name,
    type: "string | null",
    description: <>
        ID of the {object_name} record.{" "}
        <Tooltip tip="This can be expanded into an object with the expand query parameter.">
          <a href="/reference/expanding">Expandable</a>
        </Tooltip>.
      </>
  };
};

export const ExpandableFieldsList = ({resource_type}) => {
  const ExpandableFieldsByResourceType = {
    entity: ['connect', 'credit_score'],
    account: ['sensitive', 'balance', 'card_brand', 'payoff', 'transactions', 'update', 'latest_verification_session']
  };
  const ExpandableFieldsNameToValues = {
    connect: {
      key_name: 'connect',
      object_name: 'Connect'
    },
    credit_score: {
      key_name: 'credit_score',
      object_name: 'CreditScore'
    },
    sensitive: {
      key_name: 'sensitive',
      object_name: 'Sensitive'
    },
    balance: {
      key_name: 'balance',
      object_name: 'Balance'
    },
    card_brand: {
      key_name: 'card_brand',
      object_name: 'CardBrand'
    },
    payoff: {
      key_name: 'payoff',
      object_name: 'Payoff'
    },
    transactions: {
      key_name: 'transactions',
      object_name: 'Transaction'
    },
    update: {
      key_name: 'update',
      object_name: 'Update'
    },
    latest_verification_session: {
      key_name: 'latest_verification_session',
      object_name: 'AccountVerificationSession'
    }
  };
  const ExpandableFields = field_name => <ParamField body={ExpandableFieldsNameToValues[field_name].key_name} type="string | null">
        <>
          ID of the {ExpandableFieldsNameToValues[field_name].object_name} record.{" "}
          <Tooltip tip="This can be expanded into an object with the expand query parameter.">
            <a href="/reference/expanding">Expandable</a>
          </Tooltip>.
        </>
    </ParamField>;
  return ExpandableFieldsByResourceType[resource_type].map(field_name => {
    return ExpandableFields(field_name);
  });
};

export const ParamList = ({items, is_child = false}) => {
  return items.map(item => {
    const field_props = {
      id: Math.random().toString(),
      body: item.name,
      name: item.name,
      type: item.type,
      required: item.required
    };
    const enums = item.enums || [];
    const items = item.items || [];
    const has_items = items?.length > 0;
    const has_enums = enums?.length > 0;
    const should_default_open = item.defaultOpen | false;
    const render_child_item = () => {
      const child_props = {
        title: has_enums ? "Possible enum values" : "properties"
      };
      if (should_default_open) child_props.defaultOpen = true;
      const has_inline_enums = has_enums && enums.every(enum_item => typeof enum_item === 'string') && enums.map((enum_item, idx) => {
        const is_last = idx === enums.length - 1;
        const is_2nd_to_last = idx === enums.length - 2;
        return <>
            <code>{enum_item}</code>
            {is_last && ''}
            {is_2nd_to_last && ' or '}
            {!is_last && !is_2nd_to_last && ', '}
          </>;
      });
      const enum_list = has_enums && !has_inline_enums && <Accordion {...child_props}>
          {enums.map(enum_item => <>
              <code>{enum_item.name}</code>
              <br />
              <p>{enum_item.description}</p>
            </>)}
        </Accordion>;
      const item_list = has_items && <Expandable {...child_props}>
          <ParamList items={items || []} is_child />
        </Expandable>;
      return <>
          <p>
            {item.description}
            {has_inline_enums && [has_inline_enums.length > 1 ? ' One of ' : ' Must be ', ...has_inline_enums]}
          </p>

          {enum_list}
          {item_list}
        </>;
    };
    return is_child ? <ResponseField {...field_props}>{render_child_item()}</ResponseField> : <ParamField {...field_props}>{render_child_item()}</ParamField>;
  });
};

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).

## Account Objects

<Tabs>
  <Tab title="Liability">
    <ParamList
      items={[
      get_common_parameters('Account').id,
      {
          name: 'holder_id',
          type: 'string',
          description: 'The ID of the Entity who is the legal holder of this Account.',
          required: false,
      },
      get_common_parameters('Account').status([
          { name: 'active', description: 'The Account is open and is in a usable state.' },
          {
              name: 'disabled',
              description: (
                  <>
                      The Account has been disabled and is no longer usable. Check
                      the account's <code>error</code> property for more information.
                  </>
              ),
          },
          { name: 'closed', description: 'The Account has been closed, and is either fully paid-off or no longer exists.' },
      ]),
      {
          ...get_common_parameters('Account').type(['liability']),
          description: 'The type of Account. A debt-type account (Credit Card, Mortgage, etc).',
      },
      {
          name: 'liability',
          type: 'object | null',
          description: 'Liability Account information',
          items: [
              {
                  name: 'liability.name',
                  type: 'string',
                  description: 'A presentable name for the liability. Ex. Chase Sapphire Credit Card',
              },
              {
                  name: 'liability.mch_id',
                  type: 'string',
                  description: 'Unique identifier of the Merchant associated with this Account.',
              },
              {
                  name: 'liability.mask',
                  type: 'string | null',
                  description: 'The last 4 digits of the associated account number.',
              },
              {
                  name: 'liability.type',
                  type: 'enum',
                  description: (
                      <>
                          The type of liability
                          account. See <a href="/reference/accounts/overview#account-liability-types">
                          Account Liability Types.</a>
                      </>
                  ),
              },
              {
                  name: 'liability.ownership',
                  type: 'enum',
                  description: 'Indicates the type of ownership that the related Entity has over the Account.',
                  enums: [
                      { name: 'primary', description: 'Refers to the main account holder.' },
                      { name: 'authorized', description: 'The related holder was granted permission by the primary holder.' },
                      { name: 'joint', description: 'The ownership on the Account is shared between two or more holders.' },
                      { name: 'unknown', description: 'The ownership status cannot be determined.' },
                  ],
              },
              {
                  name: 'liability.fingerprint',
                  type: 'string',
                  description: 'A SHA-512 hash of the account number.',
              },
          ],
      },
      get_expandable_field('latest_verification_session'),
      {
          name: "products",
          type: "string[]",
          description: (
              <>
                  A list of products that the Account has access to. See{" "}
                  <a href="/reference/accounts/products/overview#product-names">
                      Product Names
                  </a>
                  .
              </>
          ),
      },
      {
          name: "restricted_products",
          type: "string[]",
          description: (
              <>
                  A list of products that the Account can have access to but is
                  missing some requirements. See{" "}
                  <a href="/reference/accounts/products/overview#product-names">
                      Product Names
                  </a>
                  .
              </>
          ),
      },
      {
          name: "subscriptions",
          type: "string[]",
          description: (
              <>
                  A list of products that the Account is subscribed to. See{" "}
                  <a href="/reference/accounts/subscriptions/overview#subscription-names">
                      Subscription Names
                  </a>
                  .
              </>
          ),
      },
      {
          name: "available_subscriptions",
          type: "string[]",
          description: (
              <>
                  A list of products that the Account can enroll into a subscription with. See{" "}
                  <a href="/reference/accounts/subscriptions/overview#subscription-names">
                      Subscription Names
                  </a>
                  .
              </>
          ),
      },
      {
          name: "restricted_subscriptions",
          type: "string[]",
          description: (
              <>
                  A list of products that the Account can subscribe to but is missing some requirements. See{" "}
                  <a href="/reference/accounts/subscriptions/overview#subscription-names">
                      Subscription Names
                  </a>
                  .
              </>
          ),
      },
      get_common_parameters('Account').error,
      get_common_parameters('Account').metadata,
      get_common_parameters('Account').created_at,
      get_common_parameters('Account').updated_at,
      ]}
    />

    ## Additional Properties based on liability type

    <Tabs>
      <Tab title="Auto Loan">
        <ParamList
          items={[
          get_expandable_field('update'),
          get_expandable_field('balance'),
          get_expandable_field('payoff'),
          ]}
        />
      </Tab>

      <Tab title="Collection">
        <ParamList
          items={[
          get_expandable_field('update'),
          get_expandable_field('balance'),
          ]}
        />
      </Tab>

      <Tab title="Credit Builder">
        <ParamList
          items={[
          get_expandable_field('update'),
          get_expandable_field('balance'),
          ]}
        />
      </Tab>

      <Tab title="Credit Card">
        <ParamList
          items={[
          get_expandable_field('update'),
          get_expandable_field('balance'),
          get_expandable_field('card_brand'),
          ]}
        />
      </Tab>

      <Tab title="Insurance">
        <ParamList
          items={[
          get_expandable_field('update'),
          get_expandable_field('balance'),
          ]}
        />
      </Tab>

      <Tab title="Loan">
        <ParamList
          items={[
          get_expandable_field('update'),
          get_expandable_field('balance'),
          ]}
        />
      </Tab>

      <Tab title="Medical">
        <ParamList
          items={[
          get_expandable_field('update'),
          get_expandable_field('balance'),
          ]}
        />
      </Tab>

      <Tab title="Mortgage">
        <ParamList
          items={[
          get_expandable_field('update'),
          get_expandable_field('balance'),
          ]}
        />
      </Tab>

      <Tab title="Personal Loan">
        <ParamList
          items={[
          get_expandable_field('update'),
          get_expandable_field('balance'),
          ]}
        />
      </Tab>

      <Tab title="Student Loans">
        <ParamList
          items={[
          get_expandable_field('update'),
          get_expandable_field('balance'),
          ]}
        />
      </Tab>

      <Tab title="Utility">
        <ParamList
          items={[
          get_expandable_field('update'),
          get_expandable_field('balance'),
          ]}
        />
      </Tab>
    </Tabs>
  </Tab>

  <Tab title="ACH">
    <ParamList
      items={[
      get_common_parameters('Account').id,
      {
      name: 'holder_id',
      type: 'string',
      description: 'The ID of the Entity who is the legal holder of this Account.',
      required: false,
      },
      get_common_parameters('Account').status([
      { name: 'active', description: 'The Account is open and is in a usable state.' },
      {
        name: 'disabled',
        description: (
          <>
            The Account has been disabled and is no longer usable. Check
            the account's <code>error</code> property for more information.
          </>
        ),
      },
      { name: 'closed', description: 'The Account has been closed, and is either fully paid-off or no longer exists.' },
      ]),
      {
      ...get_common_parameters('Account').type(['ach']),
      description: 'The type of Account. A bank account (Checking or Savings).',
      },
      {
      name: 'ach',
      type: 'object | null',
      required: false,
      description: 'ACH Account information.',
      items: [
        {
          name: 'ach.type',
          type: 'enum',
          required: false,
          description: 'The type of ACH Account.',
          enums: ['checking', 'savings'],
        },
        {
          name: 'ach.routing',
          type: 'string',
          required: false,
          description: 'ABA routing number of the ACH Account. (maximum of 9 characters)',
        },
        {
          name: 'ach.number',
          type: 'string',
          required: false,
          description: 'Account number of the ACH Account. (maximum of 17 characters).',
        },
      ],
      },
      get_expandable_field('latest_verification_session'),
      {
      name: "products",
      type: "string[]",
      description: (
        <>
          A list of products that the Account has access to. See{" "}
          <a href="/reference/accounts/products/overview#product-names">
            Product Names
          </a>
          .
        </>
      ),
      },
      {
      name: "restricted_products",
      type: "string[]",
      description: (
        <>
          A list of products that the Account can have access to but is
          missing some requirements. See{" "}
          <a href="/reference/accounts/products/overview#product-names">
            Product Names
          </a>
          .
        </>
      ),
      },
      get_common_parameters('Account').error,
      get_common_parameters('Account').metadata,
      get_common_parameters('Account').created_at,
      get_common_parameters('Account').updated_at,
      ]}
    />
  </Tab>
</Tabs>

## Account Liability Types

| Type             | Description                                                                                                                                             |
| ---------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `auto_loan`      | A financial obligation incurred when borrowing funds to purchase a vehicle, usually secured by the vehicle itself.                                      |
| `collection`     | An account that reflects debts not paid on time, now handled by a third-party collection agency to recover the funds.                                   |
| `credit_builder` | A type of financial arrangement, typically a small loan or secured credit card, designed to help individuals establish or improve their credit history. |
| `credit_card`    | A revolving line of credit that allows the holder to make purchases or cash advances up to a certain limit, requiring regular payments.                 |
| `insurance`      | Financial protection against specific losses in exchange for premiums paid, not typically a liability unless premiums are unpaid.                       |
| `loan`           | Money borrowed that must be repaid with interest, can include various types such as personal, auto, or business loans.                                  |
| `medical`        | Accounts representing charges for healthcare services, often resulting from treatments or procedures not fully covered by insurance.                    |
| `mortgage`       | A long-term loan secured by real estate property, used to purchase or refinance that property.                                                          |
| `personal_loan`  | An secured/unsecured loan taken out by individuals from a bank or other financial institution for personal use.                                         |
| `student_loans`  | Loans issued for the purpose of financing postsecondary education, payable under terms agreed upon completion of study.                                 |
| `utility`        | Bills owed for basic services such as electricity, water, and gas, which if unpaid, can become delinquent liabilities.                                  |

## Webhook Payload

The [Webhook](/reference/webhooks/overview) payload will contain the following information:

```json
{
  "id": "string",
  "type": "account.create" | "account.update",
  "path": "/accounts/<acc_id>",
  "event": "<evt_id>"
}
```

<RequestExample>
  ```json Liability
  {
    "id": "acc_RGACQH7XdfYhC",
    "holder_id": "ent_HYmQrVrcJQBBQ",
    "status": "active",
    "type": "liability",
    "liability": {
      "mch_id": "mch_302086",
      "mask": "1580",
      "ownership": "primary",
      "fingerprint": "27d5c0ea28338619192076d150eb7b56c288f9a1",
      "type": "credit_card",
      "name": "Chase Sapphire Reserve Credit Card"
    },
    "latest_verification_session": "avf_tB9mpmew8FLit",
    "update": {
      "id": "upt_NYV5kfjskTTCJ",
      "status": "completed",
      "account_id": "acc_RGACQH7XdfYhC",
      "source": "direct",
      "type": "credit_card",
      "credit_card": {
        "available_credit": 120000,
        "balance": 80000,
        "closed_at": null,
        "credit_limit": 200000,
        "interest_rate_percentage_max": 23.5,
        "interest_rate_percentage_min": 12.0,
        "interest_rate_type": "variable",
        "last_payment_amount": 5000,
        "last_payment_date": "2024-04-05",
        "next_payment_due_date": "2024-05-01",
        "next_payment_minimum_amount": 4000,
        "opened_at": "2018-10-30",
        "sub_type": "flexible_spending",
        "usage_pattern": "transactor"
      },
      "error": null,
      "created_at": "2024-03-20T04:43:21.434Z",
      "updated_at": "2024-03-20T04:43:21.655Z"
    },
    "balance": "bal_dGCCNWHMQYRay",
    "card_brand": {
      "id": "crd_eVRdjn4jsfk3e",
      "account_id": "acc_RGACQH7XdfYhC",
      "network": "visa",
      "issuer": "Chase",
      "last4": "8623",
      "brands": [
        {
          "id": "brand_AMxtjQzAfDCRP",
          "name": "Chase Sapphire Reserve",
          "url": "https://static.methodfi.com/card_brands/1b7ccaba6535cb837f802d968add4700.png"
        }
      ],
      "status": "completed",
      "shared": false,
      "error": null,
      "created_at": "2024-03-19T01:05:37.247Z",
      "updated_at": "2024-03-19T01:05:37.247Z"
    },
    "products": ["balance", "card_brand", "update", "payment"],
    "restricted_products": ["sensitive"],
    "subscriptions": [],
    "available_subscriptions": ["update.snapshot", "update"],
    "restricted_subscriptions": ["transactions"],
    "error": null,
    "metadata": null,
    "created_at": "2024-02-12T18:57:57.857Z",
    "updated_at": "2024-03-20T04:43:21.655Z",
  }
  ```

  ```json ACH
  {
    "id": "acc_BcRdHNjb9TYKV",
    "holder_id": "ent_wUzi83DJdx99e",
    "status": "active",
    "type": "ach",
    "ach": {
      "routing": "367537407",
      "number": "57838927",
      "type": "checking"
    },
    "latest_verification_session": "avf_7WGUjnFLcipRm",
    "products": [
      "payment"
    ],
    "restricted_products": [],
    "error": null,
    "metadata": null,
    "created_at": "2023-10-23T06:25:56.500Z",
    "updated_at": "2023-10-23T06:25:56.500Z"
  }
  ```
</RequestExample>


# Create a Payoff

POST /accounts/{acc_id}/payoffs

export const ParamList = ({items, is_child = false}) => {
  return items.map(item => {
    const field_props = {
      id: Math.random().toString(),
      body: item.name,
      name: item.name,
      type: item.type,
      required: item.required
    };
    const enums = item.enums || [];
    const items = item.items || [];
    const has_items = items?.length > 0;
    const has_enums = enums?.length > 0;
    const should_default_open = item.defaultOpen | false;
    const render_child_item = () => {
      const child_props = {
        title: has_enums ? "Possible enum values" : "properties"
      };
      if (should_default_open) child_props.defaultOpen = true;
      const has_inline_enums = has_enums && enums.every(enum_item => typeof enum_item === 'string') && enums.map((enum_item, idx) => {
        const is_last = idx === enums.length - 1;
        const is_2nd_to_last = idx === enums.length - 2;
        return <>
            <code>{enum_item}</code>
            {is_last && ''}
            {is_2nd_to_last && ' or '}
            {!is_last && !is_2nd_to_last && ', '}
          </>;
      });
      const enum_list = has_enums && !has_inline_enums && <Accordion {...child_props}>
          {enums.map(enum_item => <>
              <code>{enum_item.name}</code>
              <br />
              <p>{enum_item.description}</p>
            </>)}
        </Accordion>;
      const item_list = has_items && <Expandable {...child_props}>
          <ParamList items={items || []} is_child />
        </Expandable>;
      return <>
          <p>
            {item.description}
            {has_inline_enums && [has_inline_enums.length > 1 ? ' One of ' : ' Must be ', ...has_inline_enums]}
          </p>

          {enum_list}
          {item_list}
        </>;
    };
    return is_child ? <ResponseField {...field_props}>{render_child_item()}</ResponseField> : <ParamField {...field_props}>{render_child_item()}</ParamField>;
  });
};

Creates a new Payoff request to retrieve a payoff quote from the Account’s financial institution / lender.

Operation Type: <Tooltip tip="Your request is processed in the background. You'll receive a webhook when it's complete.">⏳ Asynchronous</Tooltip> | [Webhook Payload](overview#webhook-payload).

## Path Parameters

<ParamList
  items={[
  {
  name: 'acc_id',
  type: 'string',
  required: true,
  description: 'ID of the Account.',
  },
  ]}
/>

## Returns

Returns a Payoff object.

<RequestExample>
  ```bash cURL
  curl https://production.methodfi.com/accounts/acc_yVf3mkzbhz9tj/payoffs \
    -X POST \
    -H "Method-Version: 2024-04-04" \
    -H "Authorization: Bearer sk_WyZEWVfTcH7GqmPzUPk65Vjc"
  ```

  ```javascript Node.js
  const response = await method
    .accounts('acc_yVf3mkzbhz9tj')
    .payoffs
    .create();
  ```

  ```python Python
  response = method
    .accounts('acc_yVf3mkzbhz9tj')
    .payoffs
    .create()
  ```
</RequestExample>

<ResponseExample>
  ```json
  {
    "id": "pyf_ELGT4hfikTTCJ",
    "account_id": "acc_yVf3mkzbhz9tj",
    "status": "in_progress",
    "amount": null,
    "term": null,
    "per_diem_amount": null,
    "error": null,
    "created_at": "2024-03-14T01:41:28.434Z",
    "updated_at": "2024-03-14T01:41:28.434Z"
  }
  ```
</ResponseExample>


# List all Payoffs

GET /accounts/{acc_id}/payoffs

export const get_pagination_defaults = (resource_name = 'records') => [{
  name: 'from_date',
  type: 'string',
  required: false,
  description: `ISO 8601 formatted date (YYYY-MM-DD) to filter for ${resource_name} created on and after the date provided.`
}, {
  name: 'to_date',
  type: 'string',
  required: false,
  description: `ISO 8601 formatted date (YYYY-MM-DD) to filter for ${resource_name} created on and before the date provided.`
}, {
  name: 'page',
  type: 'string',
  required: false,
  description: `The number of the page to return.`
}, {
  name: 'page_cursor',
  type: 'string',
  required: false,
  description: <>
        The ID of a resource from which a page should start or end. Mutually exclusive with <code>page</code>.
      </>
}, {
  name: 'page_limit',
  type: 'string',
  required: false,
  description: `The number of ${resource_name} to return per page.`
}];

export const ParamList = ({items, is_child = false}) => {
  return items.map(item => {
    const field_props = {
      id: Math.random().toString(),
      body: item.name,
      name: item.name,
      type: item.type,
      required: item.required
    };
    const enums = item.enums || [];
    const items = item.items || [];
    const has_items = items?.length > 0;
    const has_enums = enums?.length > 0;
    const should_default_open = item.defaultOpen | false;
    const render_child_item = () => {
      const child_props = {
        title: has_enums ? "Possible enum values" : "properties"
      };
      if (should_default_open) child_props.defaultOpen = true;
      const has_inline_enums = has_enums && enums.every(enum_item => typeof enum_item === 'string') && enums.map((enum_item, idx) => {
        const is_last = idx === enums.length - 1;
        const is_2nd_to_last = idx === enums.length - 2;
        return <>
            <code>{enum_item}</code>
            {is_last && ''}
            {is_2nd_to_last && ' or '}
            {!is_last && !is_2nd_to_last && ', '}
          </>;
      });
      const enum_list = has_enums && !has_inline_enums && <Accordion {...child_props}>
          {enums.map(enum_item => <>
              <code>{enum_item.name}</code>
              <br />
              <p>{enum_item.description}</p>
            </>)}
        </Accordion>;
      const item_list = has_items && <Expandable {...child_props}>
          <ParamList items={items || []} is_child />
        </Expandable>;
      return <>
          <p>
            {item.description}
            {has_inline_enums && [has_inline_enums.length > 1 ? ' One of ' : ' Must be ', ...has_inline_enums]}
          </p>

          {enum_list}
          {item_list}
        </>;
    };
    return is_child ? <ResponseField {...field_props}>{render_child_item()}</ResponseField> : <ParamField {...field_props}>{render_child_item()}</ParamField>;
  });
};

Retrieve a list of Payoff requests for a specific Account.

## Path Parameters

<ParamList
  items={[
  {
  name: 'acc_id',
  type: 'string',
  required: true,
  description: 'ID of the Account.',
  }
  ]}
/>

## Query Parameters

<ParamList
  items={[
  ...get_pagination_defaults('Payoffs'),
  ]}
/>

## Returns

Returns a list of Payoffs.

<RequestExample>
  ```bash cURL
  curl "https://production.methodfi.com/acc_yVf3mkzbhz9tj/payoffs" \
    -H "Method-Version: 2024-04-04" \
    -H "Authorization: Bearer sk_WyZEWVfTcH7GqmPzUPk65Vjc"
  ```

  ```javascript Node.js
  const response = await method
    .accounts('acc_yVf3mkzbhz9tj')
    .payoffs
    .list();
  ```

  ```python Python
  response = method
    .accounts('acc_yVf3mkzbhz9tj')
    .payoffs
    .list()
  ```
</RequestExample>

<ResponseExample>
  ```json
  {
    "data": [
      {
        "id": "pyf_vWrK2f6mLrGvA",
        "status": "in_progress",
        "amount": null,
        "term": null,
        "per_diem_amount": null,
        "error": null,
        "created_at": "2024-03-14T01:41:28.434Z",
        "updated_at": "2024-03-14T01:41:28.655Z"
      },
      {
        "id": "pyf_ELGT4hfikTTCJ",
        "status": "completed",
        "amount": 6083988,
        "term": 15,
        "per_diem_amount": null,
        "error": null,
        "created_at": "2024-02-14T01:41:28.434Z",
        "updated_at": "2024-02-14T01:41:28.655Z"
      },
    ]
  }
  ```
</ResponseExample>


# The payoffs endpoint



export const get_common_parameters = (resource_name = 'resource') => {
  return {
    id: {
      name: 'id',
      type: "string",
      required: false,
      description: `Unique identifier for the ${resource_name}.`
    },
    entity_id: {
      name: 'entity_id',
      type: 'string',
      required: false,
      description: 'The ID of the associated Entity.'
    },
    account_id: {
      name: 'account_id',
      type: 'string',
      required: false,
      description: 'The ID of the associated Account.'
    },
    error: {
      name: 'error',
      type: 'object | null',
      required: false,
      description: <>
          An object representing an error that occurred while processing
          this {resource_name}. See <a href={`/reference/errors/${resource_name.replace(/^([A-Z])/, function (match) {
        return match.toLowerCase();
      }).replace(/([A-Z])/g, function (match) {
        return "-" + match.toLowerCase();
      })}-errors`}>{resource_name} errors</a>.
        </>
    },
    status_error: {
      name: 'status_error',
      type: 'object | null',
      required: false,
      description: <>
          An object representing an error that occurred while processing
          this {resource_name}. See <a href="/reference/errors/product-errors#status-errors">{resource_name} errors</a>.
        </>
    },
    metadata: {
      name: 'metadata',
      type: 'object | null',
      required: false,
      description: <>
          Additional data provided during creation.
          See <a href="/reference/metadata">metadata</a>
        </>
    },
    created_at: {
      name: 'created_at',
      type: 'string',
      required: false,
      description: `Timestamp of when the ${resource_name} was created.`
    },
    updated_at: {
      name: 'updated_at',
      type: 'string',
      required: false,
      description: `Timestamp of when the ${resource_name} was last updated.`
    },
    status: (enums = []) => ({
      name: 'status',
      type: 'enum',
      required: false,
      description: `Status of the ${resource_name}.`,
      enums
    }),
    type: (enums = []) => ({
      name: 'type',
      type: 'enum',
      required: false,
      description: `The type of ${resource_name}.`,
      enums
    })
  };
};

export const ParamList = ({items, is_child = false}) => {
  return items.map(item => {
    const field_props = {
      id: Math.random().toString(),
      body: item.name,
      name: item.name,
      type: item.type,
      required: item.required
    };
    const enums = item.enums || [];
    const items = item.items || [];
    const has_items = items?.length > 0;
    const has_enums = enums?.length > 0;
    const should_default_open = item.defaultOpen | false;
    const render_child_item = () => {
      const child_props = {
        title: has_enums ? "Possible enum values" : "properties"
      };
      if (should_default_open) child_props.defaultOpen = true;
      const has_inline_enums = has_enums && enums.every(enum_item => typeof enum_item === 'string') && enums.map((enum_item, idx) => {
        const is_last = idx === enums.length - 1;
        const is_2nd_to_last = idx === enums.length - 2;
        return <>
            <code>{enum_item}</code>
            {is_last && ''}
            {is_2nd_to_last && ' or '}
            {!is_last && !is_2nd_to_last && ', '}
          </>;
      });
      const enum_list = has_enums && !has_inline_enums && <Accordion {...child_props}>
          {enums.map(enum_item => <>
              <code>{enum_item.name}</code>
              <br />
              <p>{enum_item.description}</p>
            </>)}
        </Accordion>;
      const item_list = has_items && <Expandable {...child_props}>
          <ParamList items={items || []} is_child />
        </Expandable>;
      return <>
          <p>
            {item.description}
            {has_inline_enums && [has_inline_enums.length > 1 ? ' One of ' : ' Must be ', ...has_inline_enums]}
          </p>

          {enum_list}
          {item_list}
        </>;
    };
    return is_child ? <ResponseField {...field_props}>{render_child_item()}</ResponseField> : <ParamField {...field_props}>{render_child_item()}</ParamField>;
  });
};

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

<Info>Payoffs are currently only available for Auto Loan and Mortgage accounts</Info>

**The Payoff endpoint is available as a:**

| Type      | Use-Case                                                                                                 |
| --------- | -------------------------------------------------------------------------------------------------------- |
| `Product` | On-Demand retrieval of auto loan payoff (amount, per diem, etc) from the Account’s financial institution |

## Payoff Objects

<ParamList
  items={[
  (get_common_parameters('Payoff').id),
  (get_common_parameters('Payoff').account_id),
  {
  name: 'status',
  type: 'enum',
  required: false,
  description: 'Status of the Payoff.',
  enums: [
    {
      name: 'in_progress',
      description: 'The real-time payoff information sync is in progress.',
    },
    {
      name: 'completed',
      description: 'The payoff information was successfully synced.',
    },
    {
      name: 'failed',
      description: 'The payoff information failed to sync.',
    },
  ],
  },
  {
  name: 'amount',
  type: 'number',
  required: false,
  description: 'The payoff amount.'
  },
  {
  name: 'term',
  type: 'number',
  required: false,
  description: 'The term length of the payoff in years.'
  },
  {
  name: 'per_diem_amount',
  type: 'number',
  required: false,
  description: 'The daily interest charge amount.'
  },
  (get_common_parameters('Payoff').error),
  (get_common_parameters('Payoff').created_at),
  (get_common_parameters('Payoff').updated_at),
  ]}
/>

## Webhook Payload

The [Webhook](/reference/webhooks/overview) payload will contain the following information:

```json
{
  "id": "string",
  "type": "payoff.create" | "payoff.update",
  "path": "/accounts/<acc_id>/payoffs/<pyf_id>",
}
```

<RequestExample>
  ```json THE PAYOFF OBJECT
  {
    "id": "pyf_ELGT4hfikTTCJ",
    "status": "completed",
    "amount": 6083988,
    "term": 15,
    "per_diem_amount": null,
    "error": null,
    "created_at": "2024-03-14T01:41:28.434Z",
    "updated_at": "2024-03-14T01:41:28.655Z"
  }
  ```
</RequestExample>


# Retrieve a Payoff

GET /accounts/{acc_id}/payoffs/{pyf_id}

export const get_common_parameters = (resource_name = 'resource') => {
  return {
    id: {
      name: 'id',
      type: "string",
      required: false,
      description: `Unique identifier for the ${resource_name}.`
    },
    entity_id: {
      name: 'entity_id',
      type: 'string',
      required: false,
      description: 'The ID of the associated Entity.'
    },
    account_id: {
      name: 'account_id',
      type: 'string',
      required: false,
      description: 'The ID of the associated Account.'
    },
    error: {
      name: 'error',
      type: 'object | null',
      required: false,
      description: <>
          An object representing an error that occurred while processing
          this {resource_name}. See <a href={`/reference/errors/${resource_name.replace(/^([A-Z])/, function (match) {
        return match.toLowerCase();
      }).replace(/([A-Z])/g, function (match) {
        return "-" + match.toLowerCase();
      })}-errors`}>{resource_name} errors</a>.
        </>
    },
    status_error: {
      name: 'status_error',
      type: 'object | null',
      required: false,
      description: <>
          An object representing an error that occurred while processing
          this {resource_name}. See <a href="/reference/errors/product-errors#status-errors">{resource_name} errors</a>.
        </>
    },
    metadata: {
      name: 'metadata',
      type: 'object | null',
      required: false,
      description: <>
          Additional data provided during creation.
          See <a href="/reference/metadata">metadata</a>
        </>
    },
    created_at: {
      name: 'created_at',
      type: 'string',
      required: false,
      description: `Timestamp of when the ${resource_name} was created.`
    },
    updated_at: {
      name: 'updated_at',
      type: 'string',
      required: false,
      description: `Timestamp of when the ${resource_name} was last updated.`
    },
    status: (enums = []) => ({
      name: 'status',
      type: 'enum',
      required: false,
      description: `Status of the ${resource_name}.`,
      enums
    }),
    type: (enums = []) => ({
      name: 'type',
      type: 'enum',
      required: false,
      description: `The type of ${resource_name}.`,
      enums
    })
  };
};

export const ParamList = ({items, is_child = false}) => {
  return items.map(item => {
    const field_props = {
      id: Math.random().toString(),
      body: item.name,
      name: item.name,
      type: item.type,
      required: item.required
    };
    const enums = item.enums || [];
    const items = item.items || [];
    const has_items = items?.length > 0;
    const has_enums = enums?.length > 0;
    const should_default_open = item.defaultOpen | false;
    const render_child_item = () => {
      const child_props = {
        title: has_enums ? "Possible enum values" : "properties"
      };
      if (should_default_open) child_props.defaultOpen = true;
      const has_inline_enums = has_enums && enums.every(enum_item => typeof enum_item === 'string') && enums.map((enum_item, idx) => {
        const is_last = idx === enums.length - 1;
        const is_2nd_to_last = idx === enums.length - 2;
        return <>
            <code>{enum_item}</code>
            {is_last && ''}
            {is_2nd_to_last && ' or '}
            {!is_last && !is_2nd_to_last && ', '}
          </>;
      });
      const enum_list = has_enums && !has_inline_enums && <Accordion {...child_props}>
          {enums.map(enum_item => <>
              <code>{enum_item.name}</code>
              <br />
              <p>{enum_item.description}</p>
            </>)}
        </Accordion>;
      const item_list = has_items && <Expandable {...child_props}>
          <ParamList items={items || []} is_child />
        </Expandable>;
      return <>
          <p>
            {item.description}
            {has_inline_enums && [has_inline_enums.length > 1 ? ' One of ' : ' Must be ', ...has_inline_enums]}
          </p>

          {enum_list}
          {item_list}
        </>;
    };
    return is_child ? <ResponseField {...field_props}>{render_child_item()}</ResponseField> : <ParamField {...field_props}>{render_child_item()}</ParamField>;
  });
};

Retrieve a Payoff record for an Account.

## Path Parameters

<ParamList
  items={[
  {
  name: 'acc_id',
  type: 'string',
  required: true,
  description: 'ID of the Account.',
  },
  {
  name: 'pyf_id',
  type: 'string',
  required: true,
  description: 'ID of the Payoff.',
  },
  ]}
/>

## Returns

Returns a Payoff object.

<RequestExample>
  ```bash cURL
  curl https://production.methodfi.com/accounts/acc_yVf3mkzbhz9tj/payoffs/pyf_ELGT4hfikTTCJ \
    -X GET \
    -H "Method-Version: 2024-04-04" \
    -H "Authorization: Bearer sk_WyZEWVfTcH7GqmPzUPk65Vjc"
  ```

  ```javascript Node.js
  const response = await method
    .accounts('acc_yVf3mkzbhz9tj')
    .payoffs
    .retrieve('pyf_ELGT4hfikTTCJ');
  ```

  ```python Python
  response = method
    .accounts('acc_yVf3mkzbhz9tj')
    .payoffs
    .retrieve('pyf_ELGT4hfikTTCJ')
  ```
</RequestExample>

<ResponseExample>
  ```json
  {
    "id": "pyf_ELGT4hfikTTCJ",
    "status": "completed",
    "amount": 6083988,
    "term": 15,
    "per_diem_amount": null,
    "error": null,
    "created_at": "2024-03-14T01:41:28.434Z",
    "updated_at": "2024-03-14T01:41:28.655Z"
  }
  ```
</ResponseExample>


# List all Products

GET /accounts/{acc_id}/products

export const ParamList = ({items, is_child = false}) => {
  return items.map(item => {
    const field_props = {
      id: Math.random().toString(),
      body: item.name,
      name: item.name,
      type: item.type,
      required: item.required
    };
    const enums = item.enums || [];
    const items = item.items || [];
    const has_items = items?.length > 0;
    const has_enums = enums?.length > 0;
    const should_default_open = item.defaultOpen | false;
    const render_child_item = () => {
      const child_props = {
        title: has_enums ? "Possible enum values" : "properties"
      };
      if (should_default_open) child_props.defaultOpen = true;
      const has_inline_enums = has_enums && enums.every(enum_item => typeof enum_item === 'string') && enums.map((enum_item, idx) => {
        const is_last = idx === enums.length - 1;
        const is_2nd_to_last = idx === enums.length - 2;
        return <>
            <code>{enum_item}</code>
            {is_last && ''}
            {is_2nd_to_last && ' or '}
            {!is_last && !is_2nd_to_last && ', '}
          </>;
      });
      const enum_list = has_enums && !has_inline_enums && <Accordion {...child_props}>
          {enums.map(enum_item => <>
              <code>{enum_item.name}</code>
              <br />
              <p>{enum_item.description}</p>
            </>)}
        </Accordion>;
      const item_list = has_items && <Expandable {...child_props}>
          <ParamList items={items || []} is_child />
        </Expandable>;
      return <>
          <p>
            {item.description}
            {has_inline_enums && [has_inline_enums.length > 1 ? ' One of ' : ' Must be ', ...has_inline_enums]}
          </p>

          {enum_list}
          {item_list}
        </>;
    };
    return is_child ? <ResponseField {...field_props}>{render_child_item()}</ResponseField> : <ParamField {...field_props}>{render_child_item()}</ParamField>;
  });
};

Returns a map of Product names to Product objects for an Account.

## Path Parameters

<ParamList
  items={[
  {
  name: 'acc_id',
  type: 'string',
  required: true,
  description: 'ID of the Account.',
  },
  ]}
/>

## Returns

Returns a map of Product names to Product objects.

<RequestExample>
  ```bash cURL
  curl "https://production.methodfi.com/accounts/acc_yVf3mkzbhz9tj/products" \
    -H "Method-Version: 2024-04-04" \
    -H "Authorization: Bearer sk_WyZEWVfTcH7GqmPzUPk65Vjc"
  ```

  ```javascript Node.js
  const response = await method
    .accounts('acc_yVf3mkzbhz9tj')
    .products
    .list();
  ```

  ```python Python
  response = method
    .accounts('acc_yVf3mkzbhz9tj')
    .products
    .list()
  ```
</RequestExample>

<ResponseExample>
  ```json
  {
    "sensitive": {
      "id": "prd_mjhtYK6VJ4YW6",
      "name": "sensitive",
      "status": "available",
      "status_error": null,
      "latest_request_id": null,
      "is_subscribable": false,
      "created_at": "2024-03-26T20:25:27.261Z",
      "updated_at": "2024-03-26T20:25:27.317Z"
    },
    "balance": {
      "id": "prd_FQFHqVNiCRb7J",
      "name": "balance",
      "status": "available",
      "status_error": null,
      "latest_request_id": null,
      "is_subscribable": false,
      "created_at": "2024-03-26T20:25:27.261Z",
      "updated_at": "2024-03-26T20:25:27.316Z"
    },
    "card": {
      "id": "prd_BjyXJrYnYer79",
      "name": "card",
      "status": "available",
      "status_error": null,
      "latest_request_id": null,
      "is_subscribable": false,
      "created_at": "2024-03-26T20:25:27.261Z",
      "updated_at": "2024-03-26T20:25:27.316Z"
    },
    "payoff": {
      "id": "prd_Pqgg67jyHTqPF",
      "name": "payoff",
      "status": "unavailable",
      "status_error": {
        "type": "INVALID_REQUEST",
        "sub_type": "PRODUCT_UNAVAILABLE",
        "message": "Product is unavailable or is not in a fixable state."
      },
      "latest_request_id": null,
      "is_subscribable": false,
      "created_at": "2024-03-26T20:25:27.261Z",
      "updated_at": "2024-03-26T20:25:27.317Z"
    },
    "transactions": {
      "id": "prd_tHCXTWeCrc7KG",
      "name": "transactions",
      "status": "unavailable",
      "status_error": {
          "type": "INVALID_REQUEST",
          "sub_type": "PRODUCT_UNAVAILABLE",
          "message": "Product is unavailable or is not in a fixable state."
      },
      "latest_request_id": null,
      "is_subscribable": true,
      "created_at": "2024-03-26T20:25:27.261Z",
      "updated_at": "2024-03-26T20:25:27.317Z"
    },
    "update": {
      "id": "prd_A9R7TmKma3aj7",
      "name": "update",
      "status": "available",
      "status_error": null,
      "latest_request_id": null,
      "is_subscribable": true,
      "created_at": "2024-03-26T20:25:27.261Z",
      "updated_at": "2024-03-26T20:25:27.317Z"
    }
  }
  ```
</ResponseExample>


# The products endpoint



export const get_common_parameters = (resource_name = 'resource') => {
  return {
    id: {
      name: 'id',
      type: "string",
      required: false,
      description: `Unique identifier for the ${resource_name}.`
    },
    entity_id: {
      name: 'entity_id',
      type: 'string',
      required: false,
      description: 'The ID of the associated Entity.'
    },
    account_id: {
      name: 'account_id',
      type: 'string',
      required: false,
      description: 'The ID of the associated Account.'
    },
    error: {
      name: 'error',
      type: 'object | null',
      required: false,
      description: <>
          An object representing an error that occurred while processing
          this {resource_name}. See <a href={`/reference/errors/${resource_name.replace(/^([A-Z])/, function (match) {
        return match.toLowerCase();
      }).replace(/([A-Z])/g, function (match) {
        return "-" + match.toLowerCase();
      })}-errors`}>{resource_name} errors</a>.
        </>
    },
    status_error: {
      name: 'status_error',
      type: 'object | null',
      required: false,
      description: <>
          An object representing an error that occurred while processing
          this {resource_name}. See <a href="/reference/errors/product-errors#status-errors">{resource_name} errors</a>.
        </>
    },
    metadata: {
      name: 'metadata',
      type: 'object | null',
      required: false,
      description: <>
          Additional data provided during creation.
          See <a href="/reference/metadata">metadata</a>
        </>
    },
    created_at: {
      name: 'created_at',
      type: 'string',
      required: false,
      description: `Timestamp of when the ${resource_name} was created.`
    },
    updated_at: {
      name: 'updated_at',
      type: 'string',
      required: false,
      description: `Timestamp of when the ${resource_name} was last updated.`
    },
    status: (enums = []) => ({
      name: 'status',
      type: 'enum',
      required: false,
      description: `Status of the ${resource_name}.`,
      enums
    }),
    type: (enums = []) => ({
      name: 'type',
      type: 'enum',
      required: false,
      description: `The type of ${resource_name}.`,
      enums
    })
  };
};

export const ParamList = ({items, is_child = false}) => {
  return items.map(item => {
    const field_props = {
      id: Math.random().toString(),
      body: item.name,
      name: item.name,
      type: item.type,
      required: item.required
    };
    const enums = item.enums || [];
    const items = item.items || [];
    const has_items = items?.length > 0;
    const has_enums = enums?.length > 0;
    const should_default_open = item.defaultOpen | false;
    const render_child_item = () => {
      const child_props = {
        title: has_enums ? "Possible enum values" : "properties"
      };
      if (should_default_open) child_props.defaultOpen = true;
      const has_inline_enums = has_enums && enums.every(enum_item => typeof enum_item === 'string') && enums.map((enum_item, idx) => {
        const is_last = idx === enums.length - 1;
        const is_2nd_to_last = idx === enums.length - 2;
        return <>
            <code>{enum_item}</code>
            {is_last && ''}
            {is_2nd_to_last && ' or '}
            {!is_last && !is_2nd_to_last && ', '}
          </>;
      });
      const enum_list = has_enums && !has_inline_enums && <Accordion {...child_props}>
          {enums.map(enum_item => <>
              <code>{enum_item.name}</code>
              <br />
              <p>{enum_item.description}</p>
            </>)}
        </Accordion>;
      const item_list = has_items && <Expandable {...child_props}>
          <ParamList items={items || []} is_child />
        </Expandable>;
      return <>
          <p>
            {item.description}
            {has_inline_enums && [has_inline_enums.length > 1 ? ' One of ' : ' Must be ', ...has_inline_enums]}
          </p>

          {enum_list}
          {item_list}
        </>;
    };
    return is_child ? <ResponseField {...field_props}>{render_child_item()}</ResponseField> : <ParamField {...field_props}>{render_child_item()}</ParamField>;
  });
};

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

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

### Product Names

Products that an Account can have access to:

| Name         | Use-Case                                                                                                   | Supported Types | Resource Doc                                           |
| ------------ | ---------------------------------------------------------------------------------------------------------- | --------------- | ------------------------------------------------------ |
| `update`     | On-Demand real-time account update (balance, due dates, etc) from the Account's financial institution      | All liabilities | [Updates](/reference/accounts/updates/overview)        |
| `balance`    | On-Demand real-time balance from the Account's financial institution                                       | All liabilities | [Balances](/reference/accounts/balances/overview)      |
| `card_brand` | On-Demand retrieval of credit card metadata (Product / Brand Name, Art, etc) directly from the card issuer | Credit Cards    | [Card Brand](/reference/accounts/card-brands/overview) |
| `payoff`     | On-Demand retrieval of auto loan payoff (amount, per diem, etc) from the Account's financial institution   | Auto Loans      | [Payoffs](/reference/accounts/payoffs/overview)        |
| `payment`    | Next day electronic push payments to the Account's financial institution                                   | All liabilities | [Payments](/reference/payments/overview)               |
| `sensitive`  | On-Demand retrieval of underlying sensitive account information (PAN, CVV, account number)                 | All liabilities | [Sensitive](/reference/accounts/sensitive/overview)    |

## Product Objects

<ParamList
  items={[
  get_common_parameters('Product').id,
  {
  name: 'name',
  type: 'string',
  required: false,
  description: (
    <>
      The name of the Product. See <a href="/reference/accounts/products/overview#product-names">Product Names.</a>
    </>
  ),
  },
  get_common_parameters('Product').status([
  {
    name: 'available',
    description: 'This Product is available for requests.',
  },
  {
    name: 'unavailable',
    description: 'Product is unavailable or is not in a fixable state for this Account.',
  },
  {
    name: 'restricted',
    description: 'This Product is not available to your team at this time. Contact your Method CSM for access.',
  },
  ]),
  get_common_parameters('Product').status_error,
  {
  name: 'latest_request_id',
  type: 'string | null',
  required: false,
  description: 'ID of the most recently created Product resource.',
  },
  {
  name: 'is_subscribable',
  type: 'boolean',
  required: false,
  description: 'A field indicating whether a Product supports Subscription enrollment.',
  },
  get_common_parameters('Product').created_at,
  get_common_parameters('Product').updated_at,
  ]}
/>

## Webhook Payload

The [Webhook](/reference/webhooks/overview) payload will contain the following information:

```json
{
  "id": "string",
  "type": "product.create" | "product.update",
  "path": "/accounts/<acc_id>/products/<prd_id>",
}
```

<RequestExample>
  ```json THE PRODUCT OBJECT
  {
    "id": "prd_FQFHqVNiCRb7J",
    "name": "balance",
    "status": "available",
    "status_error": null,
    "latest_request_id": "bal_ELGT4hfikTTCJ",
    "is_subscribable": false,
    "created_at": "2024-03-26T20:25:27.261Z",
    "updated_at": "2024-03-26T20:25:27.316Z"
  }
  ```
</RequestExample>


# Retrieve a Product

GET /accounts/{acc_id}/products/{prd_id}

export const ParamList = ({items, is_child = false}) => {
  return items.map(item => {
    const field_props = {
      id: Math.random().toString(),
      body: item.name,
      name: item.name,
      type: item.type,
      required: item.required
    };
    const enums = item.enums || [];
    const items = item.items || [];
    const has_items = items?.length > 0;
    const has_enums = enums?.length > 0;
    const should_default_open = item.defaultOpen | false;
    const render_child_item = () => {
      const child_props = {
        title: has_enums ? "Possible enum values" : "properties"
      };
      if (should_default_open) child_props.defaultOpen = true;
      const has_inline_enums = has_enums && enums.every(enum_item => typeof enum_item === 'string') && enums.map((enum_item, idx) => {
        const is_last = idx === enums.length - 1;
        const is_2nd_to_last = idx === enums.length - 2;
        return <>
            <code>{enum_item}</code>
            {is_last && ''}
            {is_2nd_to_last && ' or '}
            {!is_last && !is_2nd_to_last && ', '}
          </>;
      });
      const enum_list = has_enums && !has_inline_enums && <Accordion {...child_props}>
          {enums.map(enum_item => <>
              <code>{enum_item.name}</code>
              <br />
              <p>{enum_item.description}</p>
            </>)}
        </Accordion>;
      const item_list = has_items && <Expandable {...child_props}>
          <ParamList items={items || []} is_child />
        </Expandable>;
      return <>
          <p>
            {item.description}
            {has_inline_enums && [has_inline_enums.length > 1 ? ' One of ' : ' Must be ', ...has_inline_enums]}
          </p>

          {enum_list}
          {item_list}
        </>;
    };
    return is_child ? <ResponseField {...field_props}>{render_child_item()}</ResponseField> : <ParamField {...field_props}>{render_child_item()}</ParamField>;
  });
};

Retrieves a Product record for an Account.

## Path Parameters

<ParamList
  items={[
  {
  name: 'acc_id',
  type: 'string',
  required: true,
  description: 'ID of the Account.',
  },
  {
  name: 'prd_id',
  type: 'string',
  required: true,
  description: 'ID of the Product.',
  },
  ]}
/>

## Returns

Returns a Product object.

<RequestExample>
  ```bash cURL
  curl "https://production.methodfi.com/accounts/acc_yVf3mkzbhz9tj/products/prd_FQFHqVNiCRb7J" \
    -H "Method-Version: 2024-04-04" \
    -H "Authorization: Bearer sk_WyZEWVfTcH7GqmPzUPk65Vjc"
  ```

  ```javascript Node.js
  const response = await method
    .accounts("acc_yVf3mkzbhz9tj")
    .products
    .retrieve("prd_FQFHqVNiCRb7J");
  ```

  ```python Python
  response = method
    .accounts('acc_yVf3mkzbhz9tj')
    .products
    .retrieve('prd_FQFHqVNiCRb7J')
  ```
</RequestExample>

<ResponseExample>
  ```json
  {
    "id": "prd_FQFHqVNiCRb7J",
    "name": "balance",
    "status": "available",
    "status_error": null,
    "latest_request_id": null,
    "is_subscribable": false,
    "created_at": "2024-03-26T20:25:27.261Z",
    "updated_at": "2024-03-26T20:25:27.316Z"
  }
  ```
</ResponseExample>


# Retrieve an Account

GET /accounts/{:acc_id}

export const ExpandableFieldsQueryParams = (resource_type = 'all') => {
  const entity = [{
    name: 'connect',
    description: <>This is an <a href="/reference/entities/overview">Entity</a> property, and refers to the <a href="/reference/entities/connect/overview#connect-objects">Connect Object</a>.</>
  }, {
    name: 'credit_score',
    description: <>This is an <a href="/reference/entities/overview">Entity</a> property, and refers to the <a href="/reference/entities/credit-scores/overview#creditscore-objects">CreditScore Object</a>.</>
  }, {
    name: 'attribute',
    description: <>This is an <a href="/reference/entities/overview">Entity</a> property, and refers to the <a href="/reference/entities/attributes/overview#attribute-objects">Attribute Object</a>.</>
  }, {
    name: 'identity_latest_verification_session',
    description: <>This is an <a href="/reference/entities/overview">Entity</a> property, and refers to the <a href="/reference/entities/verification-sessions/overview#entity-verification-session-objects">EntityVerificationSession Object</a>.</>
  }, {
    name: 'phone_latest_verification_session',
    description: <>This is an <a href="/reference/entities/overview">Entity</a> property, and refers to the <a href="/reference/entities/verification-sessions/overview#entity-verification-session-objects">EntityVerificationSession Object</a>.</>
  }];
  const account = [{
    name: 'sensitive',
    description: <>This is an <a href="/reference/accounts/overview">Account</a> property, and refers to the <a href="/reference/accounts/sensitive/overview#sensitive-objects">Sensitive Object</a>.</>
  }, {
    name: 'balance',
    description: <>This is an <a href="/reference/accounts/overview">Account</a> property, and refers to the <a href="/reference/accounts/balances/overview#balances-objects">Balance Object</a>.</>
  }, {
    name: 'card_brand',
    description: <>This is an <a href="/reference/accounts/overview">Account</a> property, and refers to the <a href="/reference/accounts/card-brands/overview#cardbrand-objects">CardBrand Object</a>.</>
  }, {
    name: 'payoff',
    description: <>This is an <a href="/reference/accounts/overview">Account</a> property, and refers to the <a href="/reference/accounts/payoffs/overview#payoff-objects">Payoff Object</a>.</>
  }, {
    name: 'transactions',
    description: <>This is an <a href="/reference/accounts/overview">Account</a> property, and refers to the <a href="/reference/accounts/transactions/overview#transaction-objects">Transaction Object</a>.</>
  }, {
    name: 'update',
    description: <>This is an <a href="/reference/accounts/overview">Account</a> property, and refers to the <a href="/reference/accounts/updates/overview#update-objects">Update Object</a>.</>
  }, {
    name: 'latest_verification_session',
    description: <>This is an <a href="/reference/accounts/overview">Account</a> property, and refers to the <a href="/reference/accounts/verification-sessions/overview#accountverificationsession-objects">AccountVerificationSession Object</a>.</>
  }];
  const ExpandableFieldsByResourceType = {
    entity,
    account,
    all: Array.from(new Set([...entity, ...account]))
  };
  return {
    name: "expand",
    type: "enum[]",
    description: <>
        Attributes that can be expanded into an object to
        provide additional information.
      </>,
    enums: [...ExpandableFieldsByResourceType[resource_type].map(expandable_field => ({
      ...expandable_field
    }))]
  };
};

export const ParamList = ({items, is_child = false}) => {
  return items.map(item => {
    const field_props = {
      id: Math.random().toString(),
      body: item.name,
      name: item.name,
      type: item.type,
      required: item.required
    };
    const enums = item.enums || [];
    const items = item.items || [];
    const has_items = items?.length > 0;
    const has_enums = enums?.length > 0;
    const should_default_open = item.defaultOpen | false;
    const render_child_item = () => {
      const child_props = {
        title: has_enums ? "Possible enum values" : "properties"
      };
      if (should_default_open) child_props.defaultOpen = true;
      const has_inline_enums = has_enums && enums.every(enum_item => typeof enum_item === 'string') && enums.map((enum_item, idx) => {
        const is_last = idx === enums.length - 1;
        const is_2nd_to_last = idx === enums.length - 2;
        return <>
            <code>{enum_item}</code>
            {is_last && ''}
            {is_2nd_to_last && ' or '}
            {!is_last && !is_2nd_to_last && ', '}
          </>;
      });
      const enum_list = has_enums && !has_inline_enums && <Accordion {...child_props}>
          {enums.map(enum_item => <>
              <code>{enum_item.name}</code>
              <br />
              <p>{enum_item.description}</p>
            </>)}
        </Accordion>;
      const item_list = has_items && <Expandable {...child_props}>
          <ParamList items={items || []} is_child />
        </Expandable>;
      return <>
          <p>
            {item.description}
            {has_inline_enums && [has_inline_enums.length > 1 ? ' One of ' : ' Must be ', ...has_inline_enums]}
          </p>

          {enum_list}
          {item_list}
        </>;
    };
    return is_child ? <ResponseField {...field_props}>{render_child_item()}</ResponseField> : <ParamField {...field_props}>{render_child_item()}</ParamField>;
  });
};

Returns the Account associated with the ID.

## Path Parameters

<ParamList
  items={[
  {
  name: 'acc_id',
  type: 'string',
  required: true,
  description: 'ID of the Account.',
  },
  ]}
/>

## Query Parameters

<ParamList items={[ExpandableFieldsQueryParams('account')]} />

## Returns

Returns the Account associated with the ID.

<RequestExample>
  ```bash cURL
  curl https://production.methodfi.com/accounts/acc_Zc4F2aTLt8CBt \
    -H "Method-Version: 2024-04-04" \
    -H "Authorization: Bearer sk_WyZEWVfTcH7GqmPzUPk65Vjc"
  ```

  ```javascript Node.js
  const account = await method
    .accounts
    .retrieve('acc_Zc4F2aTLt8CBt');
  ```

  ```python Python
  account = method
    .accounts
    .retrieve('acc_Zc4F2aTLt8CBt')
  ```
</RequestExample>

<ResponseExample>
  ```json
  {
    "id": "acc_Zc4F2aTLt8CBt",
    "holder_id": "ent_y1a9e1fbnJ1f3",
    "status": "active",
    "type": "liability",
    "liability": {
      "mch_id": "mch_302086",
      "mask": "1580",
      "ownership": "primary",
      "fingerprint": "27d5c0ea28338619192076d150eb7b56c288f9a1",
      "type": "credit_card",
      "name": "Chase Sapphire Reserve Credit Card"
    },
    "latest_verification_session": "avf_tB9mpmew8FLit",
    "update": "upt_TXDTR7Amyz7Az",
    "balance": "bal_dGCCNWHMQYRay",
    "card_brand": "crd_eVMDNUPfrFk3e",
    "products": ["balance", "card_brand", "update", "payment"],
    "restricted_products": ["sensitive"],
    "subscriptions": [],
    "available_subscriptions": ["update.snapshot", "update"],
    "restricted_subscriptions": ["transactions"],
    "error": null,
    "metadata": null,
    "created_at": "2024-04-12T18:57:57.857Z",
    "updated_at": "2024-04-12T18:57:58.430Z",
  }
  ```
</ResponseExample>


# Create a Sensitive

POST /accounts/{acc_id}/sensitive

export const ParamList = ({items, is_child = false}) => {
  return items.map(item => {
    const field_props = {
      id: Math.random().toString(),
      body: item.name,
      name: item.name,
      type: item.type,
      required: item.required
    };
    const enums = item.enums || [];
    const items = item.items || [];
    const has_items = items?.length > 0;
    const has_enums = enums?.length > 0;
    const should_default_open = item.defaultOpen | false;
    const render_child_item = () => {
      const child_props = {
        title: has_enums ? "Possible enum values" : "properties"
      };
      if (should_default_open) child_props.defaultOpen = true;
      const has_inline_enums = has_enums && enums.every(enum_item => typeof enum_item === 'string') && enums.map((enum_item, idx) => {
        const is_last = idx === enums.length - 1;
        const is_2nd_to_last = idx === enums.length - 2;
        return <>
            <code>{enum_item}</code>
            {is_last && ''}
            {is_2nd_to_last && ' or '}
            {!is_last && !is_2nd_to_last && ', '}
          </>;
      });
      const enum_list = has_enums && !has_inline_enums && <Accordion {...child_props}>
          {enums.map(enum_item => <>
              <code>{enum_item.name}</code>
              <br />
              <p>{enum_item.description}</p>
            </>)}
        </Accordion>;
      const item_list = has_items && <Expandable {...child_props}>
          <ParamList items={items || []} is_child />
        </Expandable>;
      return <>
          <p>
            {item.description}
            {has_inline_enums && [has_inline_enums.length > 1 ? ' One of ' : ' Must be ', ...has_inline_enums]}
          </p>

          {enum_list}
          {item_list}
        </>;
    };
    return is_child ? <ResponseField {...field_props}>{render_child_item()}</ResponseField> : <ParamField {...field_props}>{render_child_item()}</ParamField>;
  });
};

Creates a new Sensitive request to retrieve sensitive Account information.

Operation Type: <Tooltip tip="Your request is processed immediately, and you'll receive a response before proceeding. Webhooks will be fired in parallel.">⚡ Synchronous</Tooltip>

## Path Parameters

<ParamList
  items={[
  {
  name: 'acc_id',
  type: 'string',
  required: true,
  description: 'ID of the Account.',
  },
  ]}
/>

## Body

<ParamList
  items={[
  {
  name: 'expand',
  type: 'enum[]',
  required: true,
  description: 'The sensitive fields to expand in the response.',
  enums: [
    {
      name: 'credit_card.number',
      description: 'The full card number.'
    },
    {
      name: 'credit_card.exp_month',
      description: 'The card\'s expiration month.'
    },
    {
      name: 'credit_card.exp_year',
      description: 'The card\'s expiration year.'
    },
    {
      name: 'credit_card.cvv',
      description: 'The card\'s CVV.'
    },
    {
      name: 'credit_card.billing_zip_code',
      description: 'The card\'s billing zip code.'
    },
    {
      name: 'mortgage.number',
      description: 'The full mortgage number.'
    },
    {
      name: 'auto_loan.number',
      description: 'The full auto loan number.'
    },
    {
      name: 'personal_loan.number',
      description: 'The full personal loan number.'
    },
    {
      name: 'collection.number',
      description: 'The full collection number.'
    },
  ]
  },
  ]}
/>

## Returns

Returns a Sensitive object.

<RequestExample>
  ```bash cURL
  curl https://production.methodfi.com/accounts/acc_yVf3mkzbhz9tj/sensitive \
    -X POST \
    -H "Method-Version: 2024-04-04" \
    -H "Authorization: Bearer sk_WyZEWVfTcH7GqmPzUPk65Vjc" \
    -H "Content-Type: application/json" \
    -d '{
      "expand": [
        "credit_card.number",
        "credit_card.exp_month",
        "credit_card.exp_year",
        "credit_card.cvv"
      ]
    }'
  ```

  ```javascript Node.js
  const response = await method
    .accounts('acc_yVf3mkzbhz9tj')
    .sensitive
    .create({
      expand: [
        'credit_card.number',
        'credit_card.exp_month',
        'credit_card.exp_year',
        'credit_card.cvv'
      ],
    });
  ```

  ```python Python
  response = method
    .accounts('acc_yVf3mkzbhz9tj')
    .sensitive
    .create({
      'expand': [
        'credit_card.number',
        'credit_card.exp_month',
        'credit_card.exp_year',
        'credit_card.cvv'
      ]
    })
  ```
</RequestExample>

<ResponseExample>
  ```json
  {
    "id": "astv_9WBBA6TH7n7iX",
    "account_id": "acc_yVf3mkzbhz9tj",
    "type": "credit_card",
    "credit_card": {
      "number": "5555555555551580",
      "exp_month": "09",
      "exp_year": "2030",
      "cvv": "878",
      "billing_zip_code": null,
    },
    "status": "completed",
    "error": null,
    "created_at": "2024-04-26T22:50:24.857Z",
    "updated_at": "2024-04-26T22:50:24.857Z",
  }
  ```
</ResponseExample>


# The sensitive endpoint



export const get_common_parameters = (resource_name = 'resource') => {
  return {
    id: {
      name: 'id',
      type: "string",
      required: false,
      description: `Unique identifier for the ${resource_name}.`
    },
    entity_id: {
      name: 'entity_id',
      type: 'string',
      required: false,
      description: 'The ID of the associated Entity.'
    },
    account_id: {
      name: 'account_id',
      type: 'string',
      required: false,
      description: 'The ID of the associated Account.'
    },
    error: {
      name: 'error',
      type: 'object | null',
      required: false,
      description: <>
          An object representing an error that occurred while processing
          this {resource_name}. See <a href={`/reference/errors/${resource_name.replace(/^([A-Z])/, function (match) {
        return match.toLowerCase();
      }).replace(/([A-Z])/g, function (match) {
        return "-" + match.toLowerCase();
      })}-errors`}>{resource_name} errors</a>.
        </>
    },
    status_error: {
      name: 'status_error',
      type: 'object | null',
      required: false,
      description: <>
          An object representing an error that occurred while processing
          this {resource_name}. See <a href="/reference/errors/product-errors#status-errors">{resource_name} errors</a>.
        </>
    },
    metadata: {
      name: 'metadata',
      type: 'object | null',
      required: false,
      description: <>
          Additional data provided during creation.
          See <a href="/reference/metadata">metadata</a>
        </>
    },
    created_at: {
      name: 'created_at',
      type: 'string',
      required: false,
      description: `Timestamp of when the ${resource_name} was created.`
    },
    updated_at: {
      name: 'updated_at',
      type: 'string',
      required: false,
      description: `Timestamp of when the ${resource_name} was last updated.`
    },
    status: (enums = []) => ({
      name: 'status',
      type: 'enum',
      required: false,
      description: `Status of the ${resource_name}.`,
      enums
    }),
    type: (enums = []) => ({
      name: 'type',
      type: 'enum',
      required: false,
      description: `The type of ${resource_name}.`,
      enums
    })
  };
};

export const ParamList = ({items, is_child = false}) => {
  return items.map(item => {
    const field_props = {
      id: Math.random().toString(),
      body: item.name,
      name: item.name,
      type: item.type,
      required: item.required
    };
    const enums = item.enums || [];
    const items = item.items || [];
    const has_items = items?.length > 0;
    const has_enums = enums?.length > 0;
    const should_default_open = item.defaultOpen | false;
    const render_child_item = () => {
      const child_props = {
        title: has_enums ? "Possible enum values" : "properties"
      };
      if (should_default_open) child_props.defaultOpen = true;
      const has_inline_enums = has_enums && enums.every(enum_item => typeof enum_item === 'string') && enums.map((enum_item, idx) => {
        const is_last = idx === enums.length - 1;
        const is_2nd_to_last = idx === enums.length - 2;
        return <>
            <code>{enum_item}</code>
            {is_last && ''}
            {is_2nd_to_last && ' or '}
            {!is_last && !is_2nd_to_last && ', '}
          </>;
      });
      const enum_list = has_enums && !has_inline_enums && <Accordion {...child_props}>
          {enums.map(enum_item => <>
              <code>{enum_item.name}</code>
              <br />
              <p>{enum_item.description}</p>
            </>)}
        </Accordion>;
      const item_list = has_items && <Expandable {...child_props}>
          <ParamList items={items || []} is_child />
        </Expandable>;
      return <>
          <p>
            {item.description}
            {has_inline_enums && [has_inline_enums.length > 1 ? ' One of ' : ' Must be ', ...has_inline_enums]}
          </p>

          {enum_list}
          {item_list}
        </>;
    };
    return is_child ? <ResponseField {...field_props}>{render_child_item()}</ResponseField> : <ParamField {...field_props}>{render_child_item()}</ParamField>;
  });
};

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

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

## Sensitive Objects

<ParamList
  items={[
  get_common_parameters("Sensitive").id,
  get_common_parameters("Sensitive").account_id,
  get_common_parameters("Sensitive").type([
    {
      name: "credit_card",
      description: "A credit card Sensitive object.",
    },
    {
      name: "mortgage",
      description: "A mortgage Sensitive object.",
    },
    {
      name: "auto_loan",
      description: "An auto loan Sensitive object.",
    },
    {
      name: "personal_loan",
      description: "A personal loan Sensitive object.",
    },
    {
      name: "collection",
      description: "A collection Sensitive object.",
    },
  ]),
  get_common_parameters("Sensitive").status([
    {
      name: "completed",
      description: "The Sensitive request successfully completed.",
    },
    {
      name: "failed",
      description: (
        <>
          The Sensitive request failed to complete. See{" "}
          <code>error</code> field.
        </>
      ),
    },
  ]),
  get_common_parameters("Sensitive").error,
  get_common_parameters("Sensitive").created_at,
  get_common_parameters("Sensitive").updated_at,
  ]}
/>

## Additional Properties based on type

<Tabs>
  <Tab title="Credit Card">
    <ParamList
      items={[
      {
        name: "credit_card",
        type: "object | null",
        description: "The credit card sensitive object.",
        defaultOpen: true,
        items: [
          {
            name: "credit_card.number",
            type: "string | null",
            description:
              "The full Account number.",
          },
          {
            name: "credit_card.exp_month",
            type: "string | null",
            description:
              "The expiration month of the card.",
          },
          {
            name: "credit_card.exp_year",
            type: "string | null",
            description:
              "The expiration year of the card.",
          },
          {
            name: "credit_card.cvv",
            type: "string | null",
            description:
              "The cvv of the card.",
          },
          {
            name: "credit_card.billing_zip_code",
            type: "string | null",
            description:
              "The billing zip code of the card.",
          },
        ],
      }
      ]}
    />
  </Tab>

  <Tab title="Auto Loan">
    <ParamList
      items={[
      {
        name: "auto_loan",
        type: "object | null",
        description: "The auto loan sensitive object.",
        defaultOpen: true,
        items: [
          {
            name: "auto_loan.number",
            type: "string | null",
            description:
              "The full Account number.",
          },
        ],
      }
      ]}
    />
  </Tab>

  <Tab title="Mortgage">
    <ParamList
      items={[
      {
        name: "mortgage",
        type: "object | null",
        description: "The mortgage sensitive object.",
        defaultOpen: true,
        items: [
          {
            name: "mortgage.number",
            type: "string | null",
            description:
              "The full Account number.",
          },
        ],
      }
      ]}
    />
  </Tab>

  <Tab title="Personal Loan">
    <ParamList
      items={[
      {
        name: "personal_loan",
        type: "object | null",
        description: "The peronsal loan sensitive object.",
        defaultOpen: true,
        items: [
          {
            name: "personal_loan.number",
            type: "string | null",
            description:
              "The full Account number.",
          },
        ],
      }
      ]}
    />
  </Tab>

  <Tab title="Collection">
    <ParamList
      items={[
      {
        name: "collection",
        type: "object | null",
        description: "The collection sensitive object.",
        defaultOpen: true,
        items: [
          {
            name: "collection.number",
            type: "string | null",
            description:
              "The full Account number.",
          },
        ],
      }
      ]}
    />
  </Tab>
</Tabs>

## Webhook Payload

The [Webhook](/reference/webhooks/overview) payload will contain the following information:

```json
{
  "id": "string",
  "type": "sensitive.create" | "sensitive.update",
  "path": "/accounts/<acc_id>/sensitive/<astv_id>",
}
```

<RequestExample>
  ```json Credit Card
  {
    "id": "astv_9WBBA6TH7n7iX",
    "account_id": "acc_yVf3mkzbhz9tj",
    "type": "credit_card",
    "credit_card": {
      "number": "5555555555551580",
      "exp_month": "09",
      "exp_year": "2030",
      "cvv": "878",
      "billing_zip_code": null,
    },
    "status": "completed",
    "error": null,
    "created_at": "2024-04-26T22:50:24.857Z",
    "updated_at": "2024-04-26T22:50:24.857Z",
  }
  ```

  ```json Auto Loan
  {
    "id": "astv_BkdLEqDV4hyrR",
    "account_id": "acc_zcAbRXrEqVAFr",
    "type": "auto_loan",
    "auto_loan": { "number": "2719668732" },
    "status": "completed",
    "error": null,
    "created_at": "2024-04-26T22:50:24.724Z",
    "updated_at": "2024-04-26T22:50:24.724Z"
  }
  ```

  ```json Mortgage
  {
    "id": "astv_tB9mpmew8FLit",
    "account_id": "acc_RGACQH7XdfYhC",
    "type": "mortgage",
    "mortgage": { "number": "5123564678934" },
    "status": "completed",
    "error": null,
    "created_at": "2024-04-26T22:50:24.724Z",
    "updated_at": "2024-04-26T22:50:24.724Z"
  }
  ```

  ```json Personal Loan
  {
    "id": "astv_A8grUi7rzwi9g",
    "account_id": "acc_uHDiQGxiR8bqc",
    "type": "personal_loan",
    "personal_loan": { "number": "87234091345" },
    "status": "completed",
    "error": null,
    "created_at": "2024-04-26T22:50:24.724Z",
    "updated_at": "2024-04-26T22:50:24.724Z"
  }
  ```

  ```json Collection
  {
    "id": "astv_N8qBq4Xi6hnMn",
    "account_id": "acc_KgNMfWHcBtycK",
    "type": "collection",
    "collection": { "number": "304576234" },
    "status": "completed",
    "error": null,
    "created_at": "2024-04-26T22:50:24.724Z",
    "updated_at": "2024-04-26T22:50:24.724Z"
  }
  ```
</RequestExample>


# Retrieve a Sensitive

GET /accounts/{acc_id}/sensitive/{astv_id}

export const ParamList = ({items, is_child = false}) => {
  return items.map(item => {
    const field_props = {
      id: Math.random().toString(),
      body: item.name,
      name: item.name,
      type: item.type,
      required: item.required
    };
    const enums = item.enums || [];
    const items = item.items || [];
    const has_items = items?.length > 0;
    const has_enums = enums?.length > 0;
    const should_default_open = item.defaultOpen | false;
    const render_child_item = () => {
      const child_props = {
        title: has_enums ? "Possible enum values" : "properties"
      };
      if (should_default_open) child_props.defaultOpen = true;
      const has_inline_enums = has_enums && enums.every(enum_item => typeof enum_item === 'string') && enums.map((enum_item, idx) => {
        const is_last = idx === enums.length - 1;
        const is_2nd_to_last = idx === enums.length - 2;
        return <>
            <code>{enum_item}</code>
            {is_last && ''}
            {is_2nd_to_last && ' or '}
            {!is_last && !is_2nd_to_last && ', '}
          </>;
      });
      const enum_list = has_enums && !has_inline_enums && <Accordion {...child_props}>
          {enums.map(enum_item => <>
              <code>{enum_item.name}</code>
              <br />
              <p>{enum_item.description}</p>
            </>)}
        </Accordion>;
      const item_list = has_items && <Expandable {...child_props}>
          <ParamList items={items || []} is_child />
        </Expandable>;
      return <>
          <p>
            {item.description}
            {has_inline_enums && [has_inline_enums.length > 1 ? ' One of ' : ' Must be ', ...has_inline_enums]}
          </p>

          {enum_list}
          {item_list}
        </>;
    };
    return is_child ? <ResponseField {...field_props}>{render_child_item()}</ResponseField> : <ParamField {...field_props}>{render_child_item()}</ParamField>;
  });
};

Retrieve a Sensitive record for an Account.

## Path Parameters

<ParamList
  items={[
  {
  name: 'acc_id',
  type: 'string',
  required: true,
  description: 'ID of the Account.',
  },
  {
  name: 'astv_id',
  type: 'string',
  required: true,
  description: 'ID of the Sensitive.',
  },
  ]}
/>

## Returns

Returns a Sensitive object.

<RequestExample>
  ```bash cURL
  curl https://production.methodfi.com/accounts/acc_yVf3mkzbhz9tj/sensitive/astv_9WBBA6TH7n7iX \
    -X POST \
    -H "Method-Version: 2024-04-04" \
    -H "Authorization: Bearer sk_WyZEWVfTcH7GqmPzUPk65Vjc"
  ```

  ```javascript Node.js
  const response = await method
    .accounts('acc_yVf3mkzbhz9tj')
    .sensitive
    .retrieve('astv_9WBBA6TH7n7iX');
  ```

  ```python Python
  response = method
    .accounts('acc_yVf3mkzbhz9tj')
    .sensitive
    .retrieve('astv_9WBBA6TH7n7iX')
  ```
</RequestExample>

<ResponseExample>
  ```json
  {
    "id": "astv_9WBBA6TH7n7iX",
    "account_id": "acc_yVf3mkzbhz9tj",
    "type": "credit_card",
    "credit_card": {
      "number": "5555555555551580",
      "exp_month": "09",
      "exp_year": "2030",
      "cvv": "878",
      "billing_zip_code": null,
    },
    "status": "completed",
    "error": null,
    "created_at": "2024-04-26T22:50:24.857Z",
    "updated_at": "2024-04-26T22:50:24.857Z",
  }
  ```
</ResponseExample>


# Create a Subscription

POST /accounts/{acc_id}/subscriptions

export const ParamList = ({items, is_child = false}) => {
  return items.map(item => {
    const field_props = {
      id: Math.random().toString(),
      body: item.name,
      name: item.name,
      type: item.type,
      required: item.required
    };
    const enums = item.enums || [];
    const items = item.items || [];
    const has_items = items?.length > 0;
    const has_enums = enums?.length > 0;
    const should_default_open = item.defaultOpen | false;
    const render_child_item = () => {
      const child_props = {
        title: has_enums ? "Possible enum values" : "properties"
      };
      if (should_default_open) child_props.defaultOpen = true;
      const has_inline_enums = has_enums && enums.every(enum_item => typeof enum_item === 'string') && enums.map((enum_item, idx) => {
        const is_last = idx === enums.length - 1;
        const is_2nd_to_last = idx === enums.length - 2;
        return <>
            <code>{enum_item}</code>
            {is_last && ''}
            {is_2nd_to_last && ' or '}
            {!is_last && !is_2nd_to_last && ', '}
          </>;
      });
      const enum_list = has_enums && !has_inline_enums && <Accordion {...child_props}>
          {enums.map(enum_item => <>
              <code>{enum_item.name}</code>
              <br />
              <p>{enum_item.description}</p>
            </>)}
        </Accordion>;
      const item_list = has_items && <Expandable {...child_props}>
          <ParamList items={items || []} is_child />
        </Expandable>;
      return <>
          <p>
            {item.description}
            {has_inline_enums && [has_inline_enums.length > 1 ? ' One of ' : ' Must be ', ...has_inline_enums]}
          </p>

          {enum_list}
          {item_list}
        </>;
    };
    return is_child ? <ResponseField {...field_props}>{render_child_item()}</ResponseField> : <ParamField {...field_props}>{render_child_item()}</ParamField>;
  });
};

Enrolls an Account to a Subscription. Once
enrolled, the Subscription name and details will be present
on the response object.

## Path Parameters

<ParamList
  items={[
  {
  name: 'acc_id',
  type: 'string',
  required: true,
  description: 'ID of the Account.',
  }
  ]}
/>

## Body

<ParamList
  items={[
  {
  name: 'enroll',
  type: 'enum',
  required: true,
  description: (
    <>
      A <a href="/reference/accounts/subscriptions/overview#subscription-names">Subscription Name.</a>
    </>
  ),
  }
  ]}
/>

## Returns

Returns a Subscription object.

<RequestExample>
  ```bash cURL
  curl https://production.methodfi.com/accounts/acc_yVf3mkzbhz9tj/subscriptions \
    -X POST \
    -H "Method-Version: 2024-04-04" \
    -H "Authorization: Bearer sk_WyZEWVfTcH7GqmPzUPk65Vjc"
    -H "Content-Type: application/json" \
    -d '{
      "enroll": "update"
    }'
  ```

  ```javascript Node.js
  const response = await method
    .accounts('acc_yVf3mkzbhz9tj')
    .subscriptions
    .create('update');
  ```

  ```python Python
  response = method
    .accounts('acc_yVf3mkzbhz9tj')
    .subscriptions
    .create('update')
  ```
</RequestExample>

<ResponseExample>
  ```json
  {
  "id": "sub_P8c4bjj6xajxF",
  "name": "update",
  "status": "active",
  "latest_request_id": "upt_TXDTR7Amyz7Az",
  "created_at": "2024-04-10T22:14:21.951Z",
  "updated_at": "2024-04-10T22:14:21.951Z"
  }
  ```
</ResponseExample>


# Delete a Subscription

DELETE /accounts/{acc_id}/subscriptions/{sub_id}

export const ParamList = ({items, is_child = false}) => {
  return items.map(item => {
    const field_props = {
      id: Math.random().toString(),
      body: item.name,
      name: item.name,
      type: item.type,
      required: item.required
    };
    const enums = item.enums || [];
    const items = item.items || [];
    const has_items = items?.length > 0;
    const has_enums = enums?.length > 0;
    const should_default_open = item.defaultOpen | false;
    const render_child_item = () => {
      const child_props = {
        title: has_enums ? "Possible enum values" : "properties"
      };
      if (should_default_open) child_props.defaultOpen = true;
      const has_inline_enums = has_enums && enums.every(enum_item => typeof enum_item === 'string') && enums.map((enum_item, idx) => {
        const is_last = idx === enums.length - 1;
        const is_2nd_to_last = idx === enums.length - 2;
        return <>
            <code>{enum_item}</code>
            {is_last && ''}
            {is_2nd_to_last && ' or '}
            {!is_last && !is_2nd_to_last && ', '}
          </>;
      });
      const enum_list = has_enums && !has_inline_enums && <Accordion {...child_props}>
          {enums.map(enum_item => <>
              <code>{enum_item.name}</code>
              <br />
              <p>{enum_item.description}</p>
            </>)}
        </Accordion>;
      const item_list = has_items && <Expandable {...child_props}>
          <ParamList items={items || []} is_child />
        </Expandable>;
      return <>
          <p>
            {item.description}
            {has_inline_enums && [has_inline_enums.length > 1 ? ' One of ' : ' Must be ', ...has_inline_enums]}
          </p>

          {enum_list}
          {item_list}
        </>;
    };
    return is_child ? <ResponseField {...field_props}>{render_child_item()}</ResponseField> : <ParamField {...field_props}>{render_child_item()}</ParamField>;
  });
};

Deleting a Subscription means to unsubscribe or unenroll an Entity from automatically
receiving new Product resources.

## Path Parameters

<ParamList
  items={[
  {
  name: 'acc_id',
  type: 'string',
  required: true,
  description: 'ID of the Account.',
  },
  {
  name: 'sub_id',
  type: 'string',
  required: true,
  description: 'ID of the Subscription.',
  }
  ]}
/>

## Returns

Returns a Subscription object.

<RequestExample>
  ```bash cURL
  curl https://production.methodfi.com/accounts/acc_yVf3mkzbhz9tj/subscriptions/sub_xM4VcfRWcJP8D \
    -X DELETE \
    -H "Method-Version: 2024-04-04" \
    -H "Authorization: Bearer sk_WyZEWVfTcH7GqmPzUPk65Vjc"
  ```

  ```javascript Node.js
  const response = await method
    .accounts('acc_yVf3mkzbhz9tj')
    .subscriptions
    .delete('sub_xM4VcfRWcJP8D');
  ```

  ```python Python
  response = method
    .accounts('acc_yVf3mkzbhz9tj')
    .subscriptions
    .delete('sub_xM4VcfRWcJP8D')
  ```
</RequestExample>

<ResponseExample>
  ```json
  {
    "id": "sub_xM4VcfRWcJP8D",
    "name": "update",
    "status": "inactive",
    "latest_request_id": "upt_ELGT4hfikTTCJ",
    "created_at": "2024-03-27T19:05:34.417Z",
    "updated_at": "2024-03-27T19:05:34.417Z"
  }
  ```
</ResponseExample>


# List all Subscriptions

GET /accounts/{acc_id}/subscriptions

export const ParamList = ({items, is_child = false}) => {
  return items.map(item => {
    const field_props = {
      id: Math.random().toString(),
      body: item.name,
      name: item.name,
      type: item.type,
      required: item.required
    };
    const enums = item.enums || [];
    const items = item.items || [];
    const has_items = items?.length > 0;
    const has_enums = enums?.length > 0;
    const should_default_open = item.defaultOpen | false;
    const render_child_item = () => {
      const child_props = {
        title: has_enums ? "Possible enum values" : "properties"
      };
      if (should_default_open) child_props.defaultOpen = true;
      const has_inline_enums = has_enums && enums.every(enum_item => typeof enum_item === 'string') && enums.map((enum_item, idx) => {
        const is_last = idx === enums.length - 1;
        const is_2nd_to_last = idx === enums.length - 2;
        return <>
            <code>{enum_item}</code>
            {is_last && ''}
            {is_2nd_to_last && ' or '}
            {!is_last && !is_2nd_to_last && ', '}
          </>;
      });
      const enum_list = has_enums && !has_inline_enums && <Accordion {...child_props}>
          {enums.map(enum_item => <>
              <code>{enum_item.name}</code>
              <br />
              <p>{enum_item.description}</p>
            </>)}
        </Accordion>;
      const item_list = has_items && <Expandable {...child_props}>
          <ParamList items={items || []} is_child />
        </Expandable>;
      return <>
          <p>
            {item.description}
            {has_inline_enums && [has_inline_enums.length > 1 ? ' One of ' : ' Must be ', ...has_inline_enums]}
          </p>

          {enum_list}
          {item_list}
        </>;
    };
    return is_child ? <ResponseField {...field_props}>{render_child_item()}</ResponseField> : <ParamField {...field_props}>{render_child_item()}</ParamField>;
  });
};

Returns a map of Subscriptions names to Subscription objects associated with an Account, or an empty array if none have been created.

## Path Parameters

<ParamList
  items={[
  {
  name: 'acc_id',
  type: 'string',
  required: true,
  description: 'ID of the Account.',
  }
  ]}
/>

## Returns

Returns a map of Subscription names to Subscription objects.

<RequestExample>
  ```bash cURL
  curl "https://production.methodfi.com/accounts/acc_yVf3mkzbhz9tj/subscriptions" \
    -H "Method-Version: 2024-04-04" \
    -H "Authorization: Bearer sk_WyZEWVfTcH7GqmPzUPk65Vjc"
  ```

  ```javascript Node.js
  const response = await method
    .accounts('acc_yVf3mkzbhz9tj')
    .subscriptions
    .list();
  ```

  ```python Python
  response = method
    .accounts('acc_yVf3mkzbhz9tj')
    .subscriptions
    .list()
  ```
</RequestExample>

<ResponseExample>
  ```json
  {
    "transactions": {
      "id": "sub_P8c4bjj6xajxF",
      "name": "transactions",
      "status": "active",
      "latest_request_id": "txn_GBCW694AEgfAh",
      "created_at": "2024-04-10T22:14:22.420Z",
      "updated_at": "2024-04-10T22:14:22.420Z"
    },
    "update": {
      "id": "sub_xM4VcfRWcJP8D",
      "name": "update",
      "status": "active",
      "latest_request_id": "upt_TXDTR7Amyz7Az",
      "created_at": "2024-04-10T22:14:21.951Z",
      "updated_at": "2024-04-10T22:14:21.951Z"
    },
    "update.snapshot": {
      "id": "sub_Hm8QxhIAtLP2k",
      "name": "update.snapshot",
      "status": "active",
      "latest_request_id": "upt_YXZTR7Bnxq3Cw",
      "created_at": "2024-04-10T22:14:20.832Z",
      "updated_at": "2024-04-10T22:14:20.832Z"
    }
  }
  ```
</ResponseExample>


# The subscriptions endpoint



export const get_common_parameters = (resource_name = 'resource') => {
  return {
    id: {
      name: 'id',
      type: "string",
      required: false,
      description: `Unique identifier for the ${resource_name}.`
    },
    entity_id: {
      name: 'entity_id',
      type: 'string',
      required: false,
      description: 'The ID of the associated Entity.'
    },
    account_id: {
      name: 'account_id',
      type: 'string',
      required: false,
      description: 'The ID of the associated Account.'
    },
    error: {
      name: 'error',
      type: 'object | null',
      required: false,
      description: <>
          An object representing an error that occurred while processing
          this {resource_name}. See <a href={`/reference/errors/${resource_name.replace(/^([A-Z])/, function (match) {
        return match.toLowerCase();
      }).replace(/([A-Z])/g, function (match) {
        return "-" + match.toLowerCase();
      })}-errors`}>{resource_name} errors</a>.
        </>
    },
    status_error: {
      name: 'status_error',
      type: 'object | null',
      required: false,
      description: <>
          An object representing an error that occurred while processing
          this {resource_name}. See <a href="/reference/errors/product-errors#status-errors">{resource_name} errors</a>.
        </>
    },
    metadata: {
      name: 'metadata',
      type: 'object | null',
      required: false,
      description: <>
          Additional data provided during creation.
          See <a href="/reference/metadata">metadata</a>
        </>
    },
    created_at: {
      name: 'created_at',
      type: 'string',
      required: false,
      description: `Timestamp of when the ${resource_name} was created.`
    },
    updated_at: {
      name: 'updated_at',
      type: 'string',
      required: false,
      description: `Timestamp of when the ${resource_name} was last updated.`
    },
    status: (enums = []) => ({
      name: 'status',
      type: 'enum',
      required: false,
      description: `Status of the ${resource_name}.`,
      enums
    }),
    type: (enums = []) => ({
      name: 'type',
      type: 'enum',
      required: false,
      description: `The type of ${resource_name}.`,
      enums
    })
  };
};

export const ParamList = ({items, is_child = false}) => {
  return items.map(item => {
    const field_props = {
      id: Math.random().toString(),
      body: item.name,
      name: item.name,
      type: item.type,
      required: item.required
    };
    const enums = item.enums || [];
    const items = item.items || [];
    const has_items = items?.length > 0;
    const has_enums = enums?.length > 0;
    const should_default_open = item.defaultOpen | false;
    const render_child_item = () => {
      const child_props = {
        title: has_enums ? "Possible enum values" : "properties"
      };
      if (should_default_open) child_props.defaultOpen = true;
      const has_inline_enums = has_enums && enums.every(enum_item => typeof enum_item === 'string') && enums.map((enum_item, idx) => {
        const is_last = idx === enums.length - 1;
        const is_2nd_to_last = idx === enums.length - 2;
        return <>
            <code>{enum_item}</code>
            {is_last && ''}
            {is_2nd_to_last && ' or '}
            {!is_last && !is_2nd_to_last && ', '}
          </>;
      });
      const enum_list = has_enums && !has_inline_enums && <Accordion {...child_props}>
          {enums.map(enum_item => <>
              <code>{enum_item.name}</code>
              <br />
              <p>{enum_item.description}</p>
            </>)}
        </Accordion>;
      const item_list = has_items && <Expandable {...child_props}>
          <ParamList items={items || []} is_child />
        </Expandable>;
      return <>
          <p>
            {item.description}
            {has_inline_enums && [has_inline_enums.length > 1 ? ' One of ' : ' Must be ', ...has_inline_enums]}
          </p>

          {enum_list}
          {item_list}
        </>;
    };
    return is_child ? <ResponseField {...field_props}>{render_child_item()}</ResponseField> : <ParamField {...field_props}>{render_child_item()}</ParamField>;
  });
};

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)

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

### Subscription Names

Subscriptions that an Account can be enrolled in:

| Name              | Use-Case                                                                                         | Supported Types | Resource Doc                                              |
| ----------------- | ------------------------------------------------------------------------------------------------ | --------------- | --------------------------------------------------------- |
| `transactions`    | Real-time transaction (authorization, purchases, etc) notifications for Credit Card Accounts     | Credit Cards    | [Transactions](/reference/accounts/transactions/overview) |
| `update`          | Near real-time account update (balance, due dates, etc) from the Account's financial institution | All liabilities | [Updates](/reference/accounts/updates/overview)           |
| `update.snapshot` | Monthly snapshot update (balance, due dates, etc) from the Account's financial institution       | All liabilities | [Updates](/reference/accounts/updates/overview)           |

## Subscriptions Objects

<ParamList
  items={[
  get_common_parameters('Subscription').id,
  {
  name: 'name',
  type: 'string',
  required: false,
  description: (
    <>
      The name of the Subscription. See <a href="/reference/accounts/subscriptions/overview#subscription-names">Subscription Names.</a>
    </>
  ),
  },
  get_common_parameters('Subscription').status([
  {
    name: 'active',
    description: 'The associated Account is currently enrolled in this Subscription.',
  },
  ]),
  {
  name: 'latest_request_id',
  type: 'string | null',
  required: false,
  description: 'ID of the most recently created Product resource under this Subscription.',
  },
  (get_common_parameters('Subscription').created_at),
  (get_common_parameters('Subscription').updated_at),
  ]}
/>

## Webhook Payload

The [Webhook](/reference/webhooks/overview) payload will contain the following information:

```json
{
  "id": "string",
  "type": "subscription.create" | "subscription.update",
  "path": "/accounts/<acc_id>/subscriptions/<sub_id>",
}
```

<RequestExample>
  ```json THE SUBSCRIPTION OBJECT
  {
    "transactions": {
      "id": "sub_P8c4bjj6xajxF",
      "name": "transactions",
      "status": "active",
      "latest_request_id": "txn_GBCW694AEgfAh",
      "created_at": "2024-04-10T22:14:21.951Z",
      "updated_at": "2024-04-10T22:14:21.951Z"
    },
    "update": {
      "id": "sub_P8c4bjj6xajxF",
      "name": "update",
      "status": "active",
      "latest_request_id": "upt_TXDTR7Amyz7Az",
      "created_at": "2024-04-10T22:14:21.951Z",
      "updated_at": "2024-04-10T22:14:21.951Z"
    }
  }
  ```
</RequestExample>


# Retrieve a Subscription

GET /accounts/{acc_id}/subscriptions/{sub_id}

export const ParamList = ({items, is_child = false}) => {
  return items.map(item => {
    const field_props = {
      id: Math.random().toString(),
      body: item.name,
      name: item.name,
      type: item.type,
      required: item.required
    };
    const enums = item.enums || [];
    const items = item.items || [];
    const has_items = items?.length > 0;
    const has_enums = enums?.length > 0;
    const should_default_open = item.defaultOpen | false;
    const render_child_item = () => {
      const child_props = {
        title: has_enums ? "Possible enum values" : "properties"
      };
      if (should_default_open) child_props.defaultOpen = true;
      const has_inline_enums = has_enums && enums.every(enum_item => typeof enum_item === 'string') && enums.map((enum_item, idx) => {
        const is_last = idx === enums.length - 1;
        const is_2nd_to_last = idx === enums.length - 2;
        return <>
            <code>{enum_item}</code>
            {is_last && ''}
            {is_2nd_to_last && ' or '}
            {!is_last && !is_2nd_to_last && ', '}
          </>;
      });
      const enum_list = has_enums && !has_inline_enums && <Accordion {...child_props}>
          {enums.map(enum_item => <>
              <code>{enum_item.name}</code>
              <br />
              <p>{enum_item.description}</p>
            </>)}
        </Accordion>;
      const item_list = has_items && <Expandable {...child_props}>
          <ParamList items={items || []} is_child />
        </Expandable>;
      return <>
          <p>
            {item.description}
            {has_inline_enums && [has_inline_enums.length > 1 ? ' One of ' : ' Must be ', ...has_inline_enums]}
          </p>

          {enum_list}
          {item_list}
        </>;
    };
    return is_child ? <ResponseField {...field_props}>{render_child_item()}</ResponseField> : <ParamField {...field_props}>{render_child_item()}</ParamField>;
  });
};

Retrieves a Subscription record for an Account.

## Path Parameters

<ParamList
  items={[
  {
  name: 'acc_id',
  type: 'string',
  required: true,
  description: 'ID of the Account.',
  },
  {
  name: 'sub_id',
  type: 'string',
  required: true,
  description: 'ID of the Subscription.',
  }
  ]}
/>

## Returns

Returns a Subscription object.

<RequestExample>
  ```bash cURL
  curl "https://production.methodfi.com/accounts/acc_yVf3mkzbhz9tj/subscriptions/sub_P8c4bjj6xajxF" \
    -H "Method-Version: 2024-04-04" \
    -H "Authorization: Bearer sk_WyZEWVfTcH7GqmPzUPk65Vjc"
  ```

  ```javascript Node.js
  const response = await method
    .accounts("acc_yVf3mkzbhz9tj")
    .subscriptions
    .retrieve("sub_P8c4bjj6xajxF");
  ```

  ```python Python
  response = method
    .accounts('acc_yVf3mkzbhz9tj')
    .subscriptions
    .retrieve('sub_P8c4bjj6xajxF')
  ```
</RequestExample>

<ResponseExample>
  ```json
  {
    "id": "sub_P8c4bjj6xajxF",
    "name": "transactions",
    "status": "active",
    "latest_request_id": "txn_GBCW694AEgfAh",
    "created_at": "2024-04-10T22:14:21.951Z",
    "updated_at": "2024-04-10T22:14:21.951Z"
  }
  ```
</ResponseExample>


# List all Transactions

GET /accounts/{acc_id}/transactions

export const get_pagination_defaults = (resource_name = 'records') => [{
  name: 'from_date',
  type: 'string',
  required: false,
  description: `ISO 8601 formatted date (YYYY-MM-DD) to filter for ${resource_name} created on and after the date provided.`
}, {
  name: 'to_date',
  type: 'string',
  required: false,
  description: `ISO 8601 formatted date (YYYY-MM-DD) to filter for ${resource_name} created on and before the date provided.`
}, {
  name: 'page',
  type: 'string',
  required: false,
  description: `The number of the page to return.`
}, {
  name: 'page_cursor',
  type: 'string',
  required: false,
  description: <>
        The ID of a resource from which a page should start or end. Mutually exclusive with <code>page</code>.
      </>
}, {
  name: 'page_limit',
  type: 'string',
  required: false,
  description: `The number of ${resource_name} to return per page.`
}];

export const ParamList = ({items, is_child = false}) => {
  return items.map(item => {
    const field_props = {
      id: Math.random().toString(),
      body: item.name,
      name: item.name,
      type: item.type,
      required: item.required
    };
    const enums = item.enums || [];
    const items = item.items || [];
    const has_items = items?.length > 0;
    const has_enums = enums?.length > 0;
    const should_default_open = item.defaultOpen | false;
    const render_child_item = () => {
      const child_props = {
        title: has_enums ? "Possible enum values" : "properties"
      };
      if (should_default_open) child_props.defaultOpen = true;
      const has_inline_enums = has_enums && enums.every(enum_item => typeof enum_item === 'string') && enums.map((enum_item, idx) => {
        const is_last = idx === enums.length - 1;
        const is_2nd_to_last = idx === enums.length - 2;
        return <>
            <code>{enum_item}</code>
            {is_last && ''}
            {is_2nd_to_last && ' or '}
            {!is_last && !is_2nd_to_last && ', '}
          </>;
      });
      const enum_list = has_enums && !has_inline_enums && <Accordion {...child_props}>
          {enums.map(enum_item => <>
              <code>{enum_item.name}</code>
              <br />
              <p>{enum_item.description}</p>
            </>)}
        </Accordion>;
      const item_list = has_items && <Expandable {...child_props}>
          <ParamList items={items || []} is_child />
        </Expandable>;
      return <>
          <p>
            {item.description}
            {has_inline_enums && [has_inline_enums.length > 1 ? ' One of ' : ' Must be ', ...has_inline_enums]}
          </p>

          {enum_list}
          {item_list}
        </>;
    };
    return is_child ? <ResponseField {...field_props}>{render_child_item()}</ResponseField> : <ParamField {...field_props}>{render_child_item()}</ParamField>;
  });
};

Retrieve a list of Transactions objects for a specific Account.

## Path Parameters

<ParamList
  items={[
  {
  name: 'acc_id',
  type: 'string',
  required: true,
  description: 'ID of the Account.',
  }
  ]}
/>

## Query Parameters

<ParamList
  items={[
  ...get_pagination_defaults('Transactions'),
  ]}
/>

## Returns

Returns a list of transactions for the account.

<RequestExample>
  ```bash cURL
  curl "https://production.methodfi.com/accounts/acc_yVf3mkzbhz9tj/transactions?from_date=2024-03-13&to_date=2024-03-15" \
    -X GET \
    -H "Method-Version: 2024-04-04" \
    -H "Authorization: Bearer sk_WyZEWVfTcH7GqmPzUPk65Vjc"
  ```

  ```javascript Node.js
  const response = await method
    .accounts('acc_yVf3mkzbhz9tj')
    .transactions
    .list({
      from_date: '2024-03-13',
      to_date: '2024-03-15',
    });
  ```

  ```python Python
  response = method
    .accounts('acc_yVf3mkzbhz9tj')
    .transactions
    .list({
      'from_date': '2024-03-13',
      'to_date': '2024-03-15'
    })
  ```
</RequestExample>

<ResponseExample>
  ```json
  {
    "data": [
      {
        "id": "txn_bSsDNBnFBsJti",
        "account_id": "acc_xHg4lkzbfw8tj",
        "merchant": {
          "name": "Starbucks",
          "descriptor": "STARBUCKS 98101 SEATTLE WA",
          "category_code": "5812",
          "city": "Seattle",
          "state": "WA",
          "country": "USA",
        },
        "network": "visa",
        "network_data": {
          "visa_merchant_id": "967543210987",
          "visa_merchant_name": "Starbucks Store 042",
          "visa_store_id": "0042",
          "visa_store_name": "Starbucks Pike Place"
        },
        "amount": 1499,
        "currency": "USD",
        "billing_amount": 1499,
        "billing_currency": "USD",
        "status": "cleared",
        "created_at": "2024-05-07T15:30:25.467Z",
        "updated_at": "2024-05-07T15:30:25.467Z"
      },
    ]
  }
  ```
</ResponseExample>


# The transactions endpoint



export const get_common_parameters = (resource_name = 'resource') => {
  return {
    id: {
      name: 'id',
      type: "string",
      required: false,
      description: `Unique identifier for the ${resource_name}.`
    },
    entity_id: {
      name: 'entity_id',
      type: 'string',
      required: false,
      description: 'The ID of the associated Entity.'
    },
    account_id: {
      name: 'account_id',
      type: 'string',
      required: false,
      description: 'The ID of the associated Account.'
    },
    error: {
      name: 'error',
      type: 'object | null',
      required: false,
      description: <>
          An object representing an error that occurred while processing
          this {resource_name}. See <a href={`/reference/errors/${resource_name.replace(/^([A-Z])/, function (match) {
        return match.toLowerCase();
      }).replace(/([A-Z])/g, function (match) {
        return "-" + match.toLowerCase();
      })}-errors`}>{resource_name} errors</a>.
        </>
    },
    status_error: {
      name: 'status_error',
      type: 'object | null',
      required: false,
      description: <>
          An object representing an error that occurred while processing
          this {resource_name}. See <a href="/reference/errors/product-errors#status-errors">{resource_name} errors</a>.
        </>
    },
    metadata: {
      name: 'metadata',
      type: 'object | null',
      required: false,
      description: <>
          Additional data provided during creation.
          See <a href="/reference/metadata">metadata</a>
        </>
    },
    created_at: {
      name: 'created_at',
      type: 'string',
      required: false,
      description: `Timestamp of when the ${resource_name} was created.`
    },
    updated_at: {
      name: 'updated_at',
      type: 'string',
      required: false,
      description: `Timestamp of when the ${resource_name} was last updated.`
    },
    status: (enums = []) => ({
      name: 'status',
      type: 'enum',
      required: false,
      description: `Status of the ${resource_name}.`,
      enums
    }),
    type: (enums = []) => ({
      name: 'type',
      type: 'enum',
      required: false,
      description: `The type of ${resource_name}.`,
      enums
    })
  };
};

export const ParamList = ({items, is_child = false}) => {
  return items.map(item => {
    const field_props = {
      id: Math.random().toString(),
      body: item.name,
      name: item.name,
      type: item.type,
      required: item.required
    };
    const enums = item.enums || [];
    const items = item.items || [];
    const has_items = items?.length > 0;
    const has_enums = enums?.length > 0;
    const should_default_open = item.defaultOpen | false;
    const render_child_item = () => {
      const child_props = {
        title: has_enums ? "Possible enum values" : "properties"
      };
      if (should_default_open) child_props.defaultOpen = true;
      const has_inline_enums = has_enums && enums.every(enum_item => typeof enum_item === 'string') && enums.map((enum_item, idx) => {
        const is_last = idx === enums.length - 1;
        const is_2nd_to_last = idx === enums.length - 2;
        return <>
            <code>{enum_item}</code>
            {is_last && ''}
            {is_2nd_to_last && ' or '}
            {!is_last && !is_2nd_to_last && ', '}
          </>;
      });
      const enum_list = has_enums && !has_inline_enums && <Accordion {...child_props}>
          {enums.map(enum_item => <>
              <code>{enum_item.name}</code>
              <br />
              <p>{enum_item.description}</p>
            </>)}
        </Accordion>;
      const item_list = has_items && <Expandable {...child_props}>
          <ParamList items={items || []} is_child />
        </Expandable>;
      return <>
          <p>
            {item.description}
            {has_inline_enums && [has_inline_enums.length > 1 ? ' One of ' : ' Must be ', ...has_inline_enums]}
          </p>

          {enum_list}
          {item_list}
        </>;
    };
    return is_child ? <ResponseField {...field_props}>{render_child_item()}</ResponseField> : <ParamField {...field_props}>{render_child_item()}</ParamField>;
  });
};

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

<Info>Subscription to Transactions is required before receiving transactional data for an account</Info>

**The Transactions endpoint is available as a:**

| Type           | Use-Case                                                                                     |
| -------------- | -------------------------------------------------------------------------------------------- |
| `Subscription` | Real-time transaction (authorization, purchases, etc) notifications for Credit Card Accounts |

## Transaction Objects

<ParamList
  items={[
  get_common_parameters('Transaction').id,
  get_common_parameters('Transaction').account_id,
  {
  name: 'merchant',
  type: 'object',
  required: false,
  description: 'The merchant object associated with the Transaction.',
  items: [
    {
      name: 'merchant.name',
      type: 'string',
      required: false,
      description: 'Name of the merchant',
    },
    {
      name: 'merchant.descriptor',
      type: 'string',
      required: false,
      description: 'The text that appears on a customer\'s bank or credit card statement' +
        'for a transaction, typically including the merchant name, location, and optionally a' +
        'contact phone number or website URL to help customers recognize the charge.',
    },
    {
      name: 'merchant.category_code',
      type: 'string',
      required: false,
      description: 'A numeric code representing the type of business or service' +
       'the merchant provides. This is often used for classification purposes.',
    },
    {
      name: 'merchant.city',
      type: 'string',
      required: false,
      description: 'The merchant\'s city',
    },
    {
      name: 'merchant.state',
      type: 'string',
      required: false,
      description: 'The merchant\'s state',
    },
    {
      name: 'merchant.country',
      type: 'string',
      required: false,
      description: 'The merchant\'s country',
    }
  ]
  },
  {
  name: 'network',
  type: 'string',
  required: false,
  description: 'The payment network through which the Transaction was processed'
  },
  {
  name: 'network_data',
  type: 'object | null',
  required: false,
  description: 'Additional data specific to the payment network',
  items: [
    {
      name: 'network_data.visa_merchant_id',
      type: 'string',
      required: false,
      description: 'A Visa-specific identifier for the merchant',
    },
    {
      name: 'network_data.visa_merchant_name',
      type: 'string',
      required: false,
      description: 'The name of the merchant as recognized by Visa',
    },
    {
      name: 'network_data.visa_store_id',
      type: 'string',
      required: false,
      description: 'A Visa-specific for the store location, if applicable, within the merchant\'s organization',
    },
    {
      name: 'network_data.visa_store_name',
      type: 'string',
      required: false,
      description: 'The name of the specific store location',
    },
  ]
  },
  {
  name: 'amount',
  type: 'number',
  required: false,
  description: 'The amount of the Transaction in the currency specified by the currency field'
  },
  {
  name: 'currency',
  type: 'string',
  required: false,
  description: 'The currency in which the Transaction was made'
  },
  {
  name: 'billing_amount',
  type: 'number',
  required: false,
  description: 'The amount billed to the cardholder, in the currency specified by the' +
    'billing_currency field'
  },
  {
  name: 'billing_currency',
  type: 'string',
  required: false,
  description: 'The currency in which the billing amount is denominated'
  },
  {
  name: 'status',
  type: 'string',
  required: false,
  description: 'The current status of the Transaction'
  },
  get_common_parameters('Transaction').created_at,
  get_common_parameters('Transaction').updated_at,
  ]}
/>

## Webhook Payload

The [Webhook](/reference/webhooks/overview) payload will contain the following information:

```json
{
  "id": "string",
  "type": "transaction.create" | "transaction.update",
  "path": "/accounts/<acc_id>/transactions/<txn_id>",
}
```

<RequestExample>
  ```json THE TRANSACTION OBJECT
  {
    "id": "txn_bSsDNBnFBsJti",
    "account_id": "acc_xHg4lkzbfw8tj",
    "merchant": {
      "name": "Starbucks",
      "descriptor": "STARBUCKS 98101 SEATTLE WA",
      "category_code": "5812",
      "city": "Seattle",
      "state": "WA",
      "country": "USA",
    },
    "network": "visa",
    "network_data": {
      "visa_merchant_id": "967543210987",
      "visa_merchant_name": "Starbucks Store 042",
      "visa_store_id": "0042",
      "visa_store_name": "Starbucks Pike Place"
    },
    "amount": 1499,
    "currency": "USD",
    "billing_amount": 1499,
    "billing_currency": "USD",
    "status": "cleared",
    "created_at": "2024-05-07T15:30:25.467Z",
    "updated_at": "2024-05-07T15:30:25.467Z"
  }
  ```
</RequestExample>


# Retrieve a Transaction

GET /accounts/{acc_id}/transactions/{txn_id}

export const ParamList = ({items, is_child = false}) => {
  return items.map(item => {
    const field_props = {
      id: Math.random().toString(),
      body: item.name,
      name: item.name,
      type: item.type,
      required: item.required
    };
    const enums = item.enums || [];
    const items = item.items || [];
    const has_items = items?.length > 0;
    const has_enums = enums?.length > 0;
    const should_default_open = item.defaultOpen | false;
    const render_child_item = () => {
      const child_props = {
        title: has_enums ? "Possible enum values" : "properties"
      };
      if (should_default_open) child_props.defaultOpen = true;
      const has_inline_enums = has_enums && enums.every(enum_item => typeof enum_item === 'string') && enums.map((enum_item, idx) => {
        const is_last = idx === enums.length - 1;
        const is_2nd_to_last = idx === enums.length - 2;
        return <>
            <code>{enum_item}</code>
            {is_last && ''}
            {is_2nd_to_last && ' or '}
            {!is_last && !is_2nd_to_last && ', '}
          </>;
      });
      const enum_list = has_enums && !has_inline_enums && <Accordion {...child_props}>
          {enums.map(enum_item => <>
              <code>{enum_item.name}</code>
              <br />
              <p>{enum_item.description}</p>
            </>)}
        </Accordion>;
      const item_list = has_items && <Expandable {...child_props}>
          <ParamList items={items || []} is_child />
        </Expandable>;
      return <>
          <p>
            {item.description}
            {has_inline_enums && [has_inline_enums.length > 1 ? ' One of ' : ' Must be ', ...has_inline_enums]}
          </p>

          {enum_list}
          {item_list}
        </>;
    };
    return is_child ? <ResponseField {...field_props}>{render_child_item()}</ResponseField> : <ParamField {...field_props}>{render_child_item()}</ParamField>;
  });
};

Retrieve a Transaction object for an Account.

## Path Parameters

<ParamList
  items={[
  {
  name: 'acc_id',
  type: 'string',
  required: true,
  description: 'ID of the Account.',
  },
  {
  name: 'txn_id',
  type: 'string',
  required: true,
  description: 'ID of the Transaction.',
  },
  ]}
/>

## Returns

Returns a Transaction object.

<RequestExample>
  ```bash cURL
  curl https://production.methodfi.com/accounts/acc_yVf3mkzbhz9tj/transactions/txn_aRrDMAmEAtHti \
    -X GET \
    -H "Method-Version: 2024-04-04" \
    -H "Authorization: Bearer sk_WyZEWVfTcH7GqmPzUPk65Vjc"
  ```

  ```javascript Node.js
  const response = await method
    .accounts('acc_yVf3mkzbhz9tj')
    .transactions
    .retrieve('txn_aRrDMAmEAtHti');
  ```

  ```python Python
  response = method
    .accounts('acc_yVf3mkzbhz9tj')
    .transactions
    .retrieve('txn_aRrDMAmEAtHti')
  ```
</RequestExample>

<ResponseExample>
  ```json
    {
      "id": "txn_bSsDNBnFBsJti",
      "account_id": "acc_xHg4lkzbfw8tj",
      "merchant": {
        "name": "Starbucks",
        "descriptor": "STARBUCKS 98101 SEATTLE WA",
        "category_code": "5812",
        "city": "Seattle",
        "state": "WA",
        "country": "USA",
      },
      "network": "visa",
      "network_data": {
        "visa_merchant_id": "967543210987",
        "visa_merchant_name": "Starbucks Store 042",
        "visa_store_id": "0042",
        "visa_store_name": "Starbucks Pike Place"
      },
      "amount": 1499,
      "currency": "USD",
      "billing_amount": 1499,
      "billing_currency": "USD",
      "status": "cleared",
      "created_at": "2024-05-07T15:30:25.467Z",
      "updated_at": "2024-05-07T15:30:25.467Z"
    }
  ```
</ResponseExample>


# Create an Update

POST /accounts/{acc_id}/updates

export const ParamList = ({items, is_child = false}) => {
  return items.map(item => {
    const field_props = {
      id: Math.random().toString(),
      body: item.name,
      name: item.name,
      type: item.type,
      required: item.required
    };
    const enums = item.enums || [];
    const items = item.items || [];
    const has_items = items?.length > 0;
    const has_enums = enums?.length > 0;
    const should_default_open = item.defaultOpen | false;
    const render_child_item = () => {
      const child_props = {
        title: has_enums ? "Possible enum values" : "properties"
      };
      if (should_default_open) child_props.defaultOpen = true;
      const has_inline_enums = has_enums && enums.every(enum_item => typeof enum_item === 'string') && enums.map((enum_item, idx) => {
        const is_last = idx === enums.length - 1;
        const is_2nd_to_last = idx === enums.length - 2;
        return <>
            <code>{enum_item}</code>
            {is_last && ''}
            {is_2nd_to_last && ' or '}
            {!is_last && !is_2nd_to_last && ', '}
          </>;
      });
      const enum_list = has_enums && !has_inline_enums && <Accordion {...child_props}>
          {enums.map(enum_item => <>
              <code>{enum_item.name}</code>
              <br />
              <p>{enum_item.description}</p>
            </>)}
        </Accordion>;
      const item_list = has_items && <Expandable {...child_props}>
          <ParamList items={items || []} is_child />
        </Expandable>;
      return <>
          <p>
            {item.description}
            {has_inline_enums && [has_inline_enums.length > 1 ? ' One of ' : ' Must be ', ...has_inline_enums]}
          </p>

          {enum_list}
          {item_list}
        </>;
    };
    return is_child ? <ResponseField {...field_props}>{render_child_item()}</ResponseField> : <ParamField {...field_props}>{render_child_item()}</ParamField>;
  });
};

Creates a new Update request to retrieve the Account's latest details (balance, due dates, apr, etc) in real-time

Operation Type: <Tooltip tip="Your request is processed in the background. You'll receive a webhook when it's complete.">⏳ Asynchronous</Tooltip> | [Webhook Payload](overview#webhook-payload).

<ParamList
  items={[
  {
  name: 'acc_id',
  type: 'string',
  required: true,
  description: 'ID of the Account.',
  },
  ]}
/>

## Returns

Returns an Update object.

<RequestExample>
  ```bash cURL
  curl https://production.methodfi.com/accounts/acc_aEBDiLxiR8bqc/updates \
    -X POST \
    -H "Method-Version: 2024-04-04" \
    -H "Authorization: Bearer sk_WyZEWVfTcH7GqmPzUPk65Vjc"
  ```

  ```javascript Node.js
  const response = await method
    .accounts('acc_aEBDiLxiR8bqc')
    .updates
    .create();
  ```

  ```python Python
  response = method
    .accounts('acc_aEBDiLxiR8bqc')
    .updates
    .create()
  ```
</RequestExample>

<ResponseExample>
  ```json
  {
    "id": "upt_NYV5kfjskTTCJ",
    "status": "pending",
    "account_id": "acc_aEBDiLxiR8bqc",
    "source": "direct",
    "type": "credit_card",
    "credit_card": null,
    "error": null,
    "created_at": "2024-03-20T04:43:21.434Z",
    "updated_at": "2024-03-20T04:43:21.655Z"
  }
  ```
</ResponseExample>


# List all Updates

GET /accounts/{acc_id}/updates

export const get_pagination_defaults = (resource_name = 'records') => [{
  name: 'from_date',
  type: 'string',
  required: false,
  description: `ISO 8601 formatted date (YYYY-MM-DD) to filter for ${resource_name} created on and after the date provided.`
}, {
  name: 'to_date',
  type: 'string',
  required: false,
  description: `ISO 8601 formatted date (YYYY-MM-DD) to filter for ${resource_name} created on and before the date provided.`
}, {
  name: 'page',
  type: 'string',
  required: false,
  description: `The number of the page to return.`
}, {
  name: 'page_cursor',
  type: 'string',
  required: false,
  description: <>
        The ID of a resource from which a page should start or end. Mutually exclusive with <code>page</code>.
      </>
}, {
  name: 'page_limit',
  type: 'string',
  required: false,
  description: `The number of ${resource_name} to return per page.`
}];

export const ParamList = ({items, is_child = false}) => {
  return items.map(item => {
    const field_props = {
      id: Math.random().toString(),
      body: item.name,
      name: item.name,
      type: item.type,
      required: item.required
    };
    const enums = item.enums || [];
    const items = item.items || [];
    const has_items = items?.length > 0;
    const has_enums = enums?.length > 0;
    const should_default_open = item.defaultOpen | false;
    const render_child_item = () => {
      const child_props = {
        title: has_enums ? "Possible enum values" : "properties"
      };
      if (should_default_open) child_props.defaultOpen = true;
      const has_inline_enums = has_enums && enums.every(enum_item => typeof enum_item === 'string') && enums.map((enum_item, idx) => {
        const is_last = idx === enums.length - 1;
        const is_2nd_to_last = idx === enums.length - 2;
        return <>
            <code>{enum_item}</code>
            {is_last && ''}
            {is_2nd_to_last && ' or '}
            {!is_last && !is_2nd_to_last && ', '}
          </>;
      });
      const enum_list = has_enums && !has_inline_enums && <Accordion {...child_props}>
          {enums.map(enum_item => <>
              <code>{enum_item.name}</code>
              <br />
              <p>{enum_item.description}</p>
            </>)}
        </Accordion>;
      const item_list = has_items && <Expandable {...child_props}>
          <ParamList items={items || []} is_child />
        </Expandable>;
      return <>
          <p>
            {item.description}
            {has_inline_enums && [has_inline_enums.length > 1 ? ' One of ' : ' Must be ', ...has_inline_enums]}
          </p>

          {enum_list}
          {item_list}
        </>;
    };
    return is_child ? <ResponseField {...field_props}>{render_child_item()}</ResponseField> : <ParamField {...field_props}>{render_child_item()}</ParamField>;
  });
};

Retrieve a list of Update objects for a specific Account.

## Path Parameters

<ParamList
  items={[
  {
  name: 'acc_id',
  type: 'string',
  required: true,
  description: 'ID of the Account.',
  }
  ]}
/>

## Query Parameters

<ParamList
  items={[
  ...get_pagination_defaults('Updates'),
  ]}
/>

## Returns

Returns a list of Updates.

<RequestExample>
  ```bash cURL
  curl "https://production.methodfi.com/acc_yVf3mkzbhz9tj/updates" \
    -H "Method-Version: 2024-04-04" \
    -H "Authorization: Bearer sk_WyZEWVfTcH7GqmPzUPk65Vjc"
  ```

  ```javascript Node.js
  const response = await method
    .accounts('acc_yVf3mkzbhz9tj')
    .updates
    .list();
  ```

  ```python Python
  response = method
    .accounts('acc_yVf3mkzbhz9tj')
    .updates
    .list()
  ```
</RequestExample>

<ResponseExample>
  ```json
  {
    "data": [
      {
        "id": "upt_NYV5kfjskTTCJ",
        "status": "completed",
        "account_id": "acc_yVf3mkzbhz9tj",
        "source": "direct",
        "type": "credit_card",
        "credit_card": {
          "available_credit": 120000,
          "balance": 80000,
          "closed_at": null,
          "credit_limit": 200000,
          "interest_rate_percentage_max": 23.5,
          "interest_rate_percentage_min": 12.0,
          "interest_rate_type": "variable",
          "last_payment_amount": 5000,
          "last_payment_date": "2024-04-05",
          "next_payment_due_date": "2024-05-01",
          "next_payment_minimum_amount": 4000,
          "opened_at": "2018-10-30",
          "sub_type": "flexible_spending",
          "usage_pattern": "transactor"
        },
        "error": null,
        "created_at": "2024-03-20T04:43:21.434Z",
        "updated_at": "2024-03-20T04:43:21.655Z"
      },
      {...}
    ]
  }
  ```
</ResponseExample>


# The updates endpoint



export const get_update_liability_fields = (liability_type, specific_fields) => {
  const alphabetically_sort_fields = fields => {
    fields.sort((a, b) => {
      if (a.name.toLowerCase() < b.name.toLowerCase()) return -1;
      if (a.name.toLowerCase() > b.name.toLowerCase()) return 1;
      return 0;
    });
    return fields;
  };
  const default_fields = specific_fields.concat([{
    name: `${liability_type}.opened_at`,
    type: 'string | null',
    required: false,
    description: 'The date when the account was originally opened, formatted in ISO 8601 (YYYY-MM-DD).'
  }, {
    name: `${liability_type}.closed_at`,
    type: 'string | null',
    required: false,
    description: 'The date on which the account was officially closed, formatted in ISO 8601 (YYYY-MM-DD).'
  }, {
    name: `${liability_type}.balance`,
    type: 'string | null',
    required: false,
    description: 'The current balance of the account.'
  }, {
    name: `${liability_type}.last_payment_date`,
    type: 'string | null',
    required: false,
    description: 'ISO 8601 formatted date (YYYY-MM-DD) of the last payment on the account.'
  }, {
    name: `${liability_type}.last_payment_amount`,
    type: 'number | null',
    required: false,
    description: 'The amount of the last payment on the account.'
  }, {
    name: `${liability_type}.next_payment_due_date`,
    type: 'string | null',
    required: false,
    description: 'ISO 8601 formatted date (YYYY-MM-DD) of the next minimum payment on the account.'
  }, {
    name: `${liability_type}.next_payment_minimum_amount`,
    type: 'number | null',
    required: false,
    description: 'The amount of the next minimum payment on the account.'
  }]);
  const more_shared_fields = {
    term_length: {
      name: `${liability_type}.term_length`,
      type: 'number | null',
      required: false,
      description: 'The duration of the loan or liability term, expressed in months.'
    },
    original_loan_amount: {
      name: `${liability_type}.original_loan_amount`,
      type: 'number | null',
      required: false,
      description: 'The initial amount of money borrowed at the time the debt was issued.'
    },
    available_credit: {
      name: `${liability_type}.available_credit`,
      type: 'number | null',
      required: false,
      description: 'The amount of credit currently available for use on this account.'
    },
    expected_payoff_date: {
      name: `${liability_type}.expected_payoff_date`,
      type: 'string | null',
      required: false,
      description: 'The anticipated date when the liability or loan will be fully paid off, formatted in ISO 8601 (YYYY-MM-DD).'
    },
    interest_rate_type: {
      name: `${liability_type}.interest_rate_type`,
      type: 'enum | null',
      required: false,
      description: 'The liability interest rate type.',
      enums: ['fixed', 'variable']
    },
    interest_rate_source: {
      name: `${liability_type}.interest_rate_source`,
      type: 'enum | null',
      required: false,
      description: 'The liability interest rate source.',
      enums: ['financial_institution', 'public_data', 'method']
    },
    interest_rate_percentage_max: {
      name: `${liability_type}.interest_rate_percentage_max`,
      type: 'number | null',
      required: false,
      description: 'The maximum interest rate (variable) allowed for this account.'
    },
    interest_rate_percentage_min: {
      name: `${liability_type}.interest_rate_percentage_min`,
      type: 'number | null',
      required: false,
      description: 'The minimum interest rate (variable) allowed for this account.'
    },
    interest_rate_percentage: {
      name: `${liability_type}.interest_rate_percentage`,
      type: 'number | null',
      required: false,
      description: 'The fixed interest rate for this account.'
    }
  };
  switch (liability_type) {
    case 'auto_loan':
      {
        default_fields.push(more_shared_fields.term_length, more_shared_fields.original_loan_amount, more_shared_fields.expected_payoff_date, more_shared_fields.interest_rate_type, more_shared_fields.interest_rate_source, more_shared_fields.interest_rate_percentage_max, more_shared_fields.interest_rate_percentage_min, more_shared_fields.interest_rate_percentage);
        break;
      }
    case 'personal_loan':
      {
        default_fields.push(more_shared_fields.available_credit, more_shared_fields.term_length, more_shared_fields.original_loan_amount, more_shared_fields.interest_rate_type, more_shared_fields.interest_rate_source, more_shared_fields.interest_rate_percentage_max, more_shared_fields.interest_rate_percentage_min, more_shared_fields.interest_rate_percentage);
        break;
      }
    case 'student_loans':
      {
        default_fields.push(more_shared_fields.term_length, more_shared_fields.original_loan_amount);
        break;
      }
    case 'mortgage':
      {
        default_fields.push(more_shared_fields.term_length, more_shared_fields.original_loan_amount, more_shared_fields.expected_payoff_date, more_shared_fields.interest_rate_type, more_shared_fields.interest_rate_source, more_shared_fields.interest_rate_percentage_max, more_shared_fields.interest_rate_percentage_min, more_shared_fields.interest_rate_percentage);
        break;
      }
    case 'credit_card':
      {
        default_fields.push(more_shared_fields.available_credit, more_shared_fields.interest_rate_type, more_shared_fields.interest_rate_source, more_shared_fields.interest_rate_percentage_max, more_shared_fields.interest_rate_percentage_min, more_shared_fields.interest_rate_percentage);
        break;
      }
    default:
  }
  return {
    name: liability_type,
    type: 'object | null',
    description: <>This object will be populated if the Update is of type <code>{liability_type}</code>.</>,
    items: alphabetically_sort_fields(default_fields),
    defaultOpen: true
  };
};

export const get_common_parameters = (resource_name = 'resource') => {
  return {
    id: {
      name: 'id',
      type: "string",
      required: false,
      description: `Unique identifier for the ${resource_name}.`
    },
    entity_id: {
      name: 'entity_id',
      type: 'string',
      required: false,
      description: 'The ID of the associated Entity.'
    },
    account_id: {
      name: 'account_id',
      type: 'string',
      required: false,
      description: 'The ID of the associated Account.'
    },
    error: {
      name: 'error',
      type: 'object | null',
      required: false,
      description: <>
          An object representing an error that occurred while processing
          this {resource_name}. See <a href={`/reference/errors/${resource_name.replace(/^([A-Z])/, function (match) {
        return match.toLowerCase();
      }).replace(/([A-Z])/g, function (match) {
        return "-" + match.toLowerCase();
      })}-errors`}>{resource_name} errors</a>.
        </>
    },
    status_error: {
      name: 'status_error',
      type: 'object | null',
      required: false,
      description: <>
          An object representing an error that occurred while processing
          this {resource_name}. See <a href="/reference/errors/product-errors#status-errors">{resource_name} errors</a>.
        </>
    },
    metadata: {
      name: 'metadata',
      type: 'object | null',
      required: false,
      description: <>
          Additional data provided during creation.
          See <a href="/reference/metadata">metadata</a>
        </>
    },
    created_at: {
      name: 'created_at',
      type: 'string',
      required: false,
      description: `Timestamp of when the ${resource_name} was created.`
    },
    updated_at: {
      name: 'updated_at',
      type: 'string',
      required: false,
      description: `Timestamp of when the ${resource_name} was last updated.`
    },
    status: (enums = []) => ({
      name: 'status',
      type: 'enum',
      required: false,
      description: `Status of the ${resource_name}.`,
      enums
    }),
    type: (enums = []) => ({
      name: 'type',
      type: 'enum',
      required: false,
      description: `The type of ${resource_name}.`,
      enums
    })
  };
};

export const ParamList = ({items, is_child = false}) => {
  return items.map(item => {
    const field_props = {
      id: Math.random().toString(),
      body: item.name,
      name: item.name,
      type: item.type,
      required: item.required
    };
    const enums = item.enums || [];
    const items = item.items || [];
    const has_items = items?.length > 0;
    const has_enums = enums?.length > 0;
    const should_default_open = item.defaultOpen | false;
    const render_child_item = () => {
      const child_props = {
        title: has_enums ? "Possible enum values" : "properties"
      };
      if (should_default_open) child_props.defaultOpen = true;
      const has_inline_enums = has_enums && enums.every(enum_item => typeof enum_item === 'string') && enums.map((enum_item, idx) => {
        const is_last = idx === enums.length - 1;
        const is_2nd_to_last = idx === enums.length - 2;
        return <>
            <code>{enum_item}</code>
            {is_last && ''}
            {is_2nd_to_last && ' or '}
            {!is_last && !is_2nd_to_last && ', '}
          </>;
      });
      const enum_list = has_enums && !has_inline_enums && <Accordion {...child_props}>
          {enums.map(enum_item => <>
              <code>{enum_item.name}</code>
              <br />
              <p>{enum_item.description}</p>
            </>)}
        </Accordion>;
      const item_list = has_items && <Expandable {...child_props}>
          <ParamList items={items || []} is_child />
        </Expandable>;
      return <>
          <p>
            {item.description}
            {has_inline_enums && [has_inline_enums.length > 1 ? ' One of ' : ' Must be ', ...has_inline_enums]}
          </p>

          {enum_list}
          {item_list}
        </>;
    };
    return is_child ? <ResponseField {...field_props}>{render_child_item()}</ResponseField> : <ParamField {...field_props}>{render_child_item()}</ParamField>;
  });
};

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

<Check>Method's real-time `direct` update coverage expands to 92% of all outstanding debt.</Check>

**The Updates endpoint is available as a:**

| Type           | Use-Case                                                                                                                              |
| -------------- | ------------------------------------------------------------------------------------------------------------------------------------- |
| `Product`      | On-Demand real-time account update (balance, due dates, etc) from the Account’s financial institution                                 |
| `Subscription` | Near real-time account update (balance, due dates, etc) from the Account’s financial institution. [Webhook Payload](#webhook-payload) |

## Update Objects

<ParamList
  items={[
  (get_common_parameters('Update').id),
  (get_common_parameters('Update').account_id),
  {
  name: 'source',
  type: 'enum',
  description: 'The source of the Update\'s data.',
  enums: [
    { name: 'direct', description: 'Updates received directly from the financial institution.' },
    { name: 'snapshot', description: 'Updates received from a monthly snapshot view from the financial institution.' },
  ],
  },
  (get_common_parameters('Update').status([
  {
    name: 'pending',
    description: 'The Update request is queued to be processed.',
  },
  {
    name: 'in_progress',
    description: 'The Update request is being processed.',
  },
  {
    name: 'completed',
    description: 'The Update request has successfully processed.',
  },
  {
    name: 'failed',
    description: 'The Update request failed processing.',
  },
  ])),
  {
  name: 'type',
  type: 'enum',
  description: (
    <>
      The liability type of the Update's Account.
      See <a href="/reference/accounts/overview#account-liability-types">Account Liability Types.</a>
    </>
  ),
  },
  (get_common_parameters('Update').error),
  (get_common_parameters('Update').created_at),
  (get_common_parameters('Update').updated_at),
  ]}
/>

## Properties based on type

<Tabs>
  <Tab title="Credit Card">
    <ParamList
      items={[get_update_liability_fields('credit_card', [
      {
      name: 'credit_card.credit_limit',
      type: 'number | null',
      required: false,
      description: 'The maximum amount of credit that can be extended to the borrower on this account.',
      },
      {
      name: 'credit_card.next_statement_date',
      type: 'string | null',
      required: false,
      description: 'The date when the next statement for the credit card will be issued, formatted in ISO 8601 (YYYY-MM-DD).',
      },
      {
      name: 'credit_card.usage_pattern',
      type: 'enum | null',
      required: false,
      description: 'Categorizes the usage behavior of the credit card holder.',
      enums: [
        { name: 'transactor', description: 'Pays balances in full each month.' },
        { name: 'revolver', description: 'Carries balances from month to month.' },
        { name: 'dormant', description: 'An inactive account with no recent transactions.' },
        { name: 'unknown', description: 'Usage pattern is not determined or not available.' }
      ],
      },
      {
      name: 'credit_card.sub_type',
      type: 'enum | null',
      required: false,
      description: 'Sub-type of the credit card.',
      enums: ['flexible_spending', 'charge', 'secured', 'unsecured', 'purchase', 'business'],
      },
      ])]}
    />
  </Tab>

  <Tab title="Mortgage">
    <ParamList items={[get_update_liability_fields('mortgage', [])]} />
  </Tab>

  <Tab title="Auto Loan">
    <ParamList
      items={[get_update_liability_fields('auto_loan', [
      {
      name: 'auto_loan.sub_type',
      type: 'enum | null',
      required: false,
      description: 'Sub-type of the auto loan.',
      enums: ['lease', 'loan'],
      },
      ])]}
    />
  </Tab>

  <Tab title="Personal Loan">
    <ParamList
      items={[get_update_liability_fields('personal_loan', [
      {
      name: 'personal_loan.sub_type',
      type: 'enum | null',
      required: false,
      description: 'Sub-type of the personal loan.',
      enums: ['secured', 'unsecured', 'heloc', 'line_of_credit', 'note'],
      },
      ])]}
    />
  </Tab>

  <Tab title="Student Loans">
    <ParamList
      items={[get_update_liability_fields('student_loans', [
      {
      name: 'student_loans.disbursements',
      type: 'object[]',
      required: false,
      description: 'A list of individual student loan disbursements.',
      items: [
        {
          name: 'student_loans.disbursements.sequence',
          type: 'number',
          required: false,
          description: 'The sequence number of this disbursement.'
        },
        {
          name: 'student_loans.disbursements.balance',
          type: 'number | null',
          required: false,
          description: 'The current balance of this disbursement.'
        },
        {
          name: 'student_loans.disbursements.last_payment_amount',
          type: 'number | null',
          required: false,
          description: 'The amount of the last payment on this disbursement.'
        },
        {
          name: 'student_loans.disbursements.last_payment_date',
          type: 'string | null',
          required: false,
          description: 'ISO 8601 formatted date (YYYY-MM-DD) of the last payment on the account.'
        },
        {
          name: 'student_loans.disbursements.next_payment_due_date',
          type: 'string | null',
          required: false,
          description: 'ISO 8601 formatted date (YYYY-MM-DD) of the next minimum payment on the account.'
        },
        {
          name: 'student_loans.disbursements.next_payment_minimum_amount',
          type: 'number | null',
          required: false,
          description: 'The amount of the next minimum payment on the account.'
        },
        {
          name: 'student_loans.disbursements.disbursed_at',
          type: 'string | null',
          required: false,
          description: 'The date when the disbursement was made, formatted in ISO 8601 (YYYY-MM-DD).'
        },
        {
          name: 'student_loans.disbursements.interest_rate_percentage',
          type: 'number | null',
          required: false,
          description: 'The fixed interest rate for this disbursement.'
        },
        {
          name: 'student_loans.disbursements.interest_rate_percentage_max',
          type: 'number | null',
          required: false,
          description: 'The maximum interest rate (variable) allowed for this disbursement.'
        },
        {
          name: 'student_loans.disbursements.interest_rate_percentage_min',
          type: 'number | null',
          required: false,
          description: 'The minimum interest rate (variable) allowed for this disbursement.'
        },
        {
          name: 'student_loans.disbursements.interest_rate_type',
          type: 'enum | null',
          required: false,
          description: 'The type of interest rate for this disbursement.',
          enums: ['fixed', 'variable']
        },
        {
          name: 'student_loans.disbursements.original_loan_amount',
          type: 'number | null',
          required: false,
          description: 'The original loan amount for this disbursement.'
        },
        {
          name: 'student_loans.disbursements.term_length',
          type: 'number | null',
          required: false,
          description: 'The length of the term for this disbursement, in months.'
        },
        {
          name: 'student_loans.disbursements.closed_at',
          type: 'string | null',
          required: false,
          description: 'The date when the disbursement was closed, if applicable, formatted in ISO 8601 (YYYY-MM-DD).'
        },
        {
          name: 'student_loans.disbursements.interest_rate_source',
          type: 'enum | null',
          required: false,
          description: 'The source of the interest rate.',
          enums: ['financial_institution', 'public_data', 'method']
        },
      ],
      },
      {
      name: 'student_loans.sub_type',
      type: 'enum | null',
      required: false,
      description: 'Sub-type of the student loan.',
      enums: ['federal', 'private'],
      },
      ])]}
    />
  </Tab>
</Tabs>

## Webhook Payload

The [Webhook](/reference/webhooks/overview) payload will contain the following information:

```json
{
  "id": "string",
  "type": "update.create" | "update.update",
  "path": "/accounts/<acc_id>/updates/<upt_id>",
}
```

<RequestExample>
  ```json Credit Card
  {
    "id": "upt_NYV5kfjskTTCJ",
    "status": "completed",
    "account_id": "acc_bFDiQGxiR8bqc",
    "source": "direct",
    "type": "credit_card",
    "credit_card": {
      "available_credit": 120000,
      "balance": 80000,
      "closed_at": null,
      "credit_limit": 200000,
      "interest_rate_percentage_max": 23.5,
      "interest_rate_percentage_min": 12.0,
      "interest_rate_type": "variable",
      "last_payment_amount": 5000,
      "last_payment_date": "2024-04-05",
      "next_payment_due_date": "2024-05-01",
      "next_payment_minimum_amount": 4000,
      "opened_at": "2018-10-30",
      "sub_type": "flexible_spending",
      "usage_pattern": "transactor"
    },
    "error": null,
    "created_at": "2024-03-20T04:43:21.434Z",
    "updated_at": "2024-03-20T04:43:21.655Z"
  }
  ```

  ```json Auto Loan
  {
    "id": "upt_ELGT4hfikTTCJ",
    "status": "completed",
    "account_id": "acc_aEBDiLxiR8bqc",
    "source": "direct",
    "type": "auto_loan",
    "auto_loan": {
      "balance": 1500000,
      "closed_at": null,
      "expected_payoff_date": "2029-04-15",
      "interest_rate_percentage": 3.5,
      "interest_rate_source": "financial_institution",
      "interest_rate_type": "fixed",
      "last_payment_amount": 35000,
      "last_payment_date": "2024-03-15",
      "next_payment_due_date": "2024-05-15",
      "next_payment_minimum_amount": 35000,
      "opened_at": "2019-04-15",
      "original_loan_amount": 2000000,
      "sub_type": "loan",
      "term_length": 120
    },
    "error": null,
    "created_at": "2024-03-20T04:43:21.434Z",
    "updated_at": "2024-03-20T04:43:21.655Z"
  }
  ```

  ```json Mortgage
  {
    "id": "upt_ZXJ9hfjskTTCJ",
    "status": "completed",
    "account_id": "acc_xDGiQGxiR8bqc",
    "source": "direct",
    "type": "mortgage",
    "mortgage": {
      "balance": 71250000,
      "closed_at": null,
      "expected_payoff_date": "2044-04-15",
      "interest_rate_percentage": 3.09,
      "interest_rate_source": "financial_institution",
      "interest_rate_type": "fixed",
      "last_payment_amount": 250000,
      "last_payment_date": "2024-03-15",
      "next_payment_due_date": "2024-05-15",
      "next_payment_minimum_amount": 250000,
      "opened_at": "2019-04-15",
      "original_loan_amount": 120000000,
      "sub_type": "loan",
      "term_length": 300
    },
    "error": null,
    "created_at": "2024-03-20T04:43:21.434Z",
    "updated_at": "2024-03-20T04:43:21.655Z"
  }
  ```

  ```json Personal Loan
  {
    "id": "upt_HKJ9kfjskTTCJ",
    "status": "completed",
    "account_id": "acc_zFDiQGxiR8bqc",
    "source": "snapshot",
    "type": "personal_loan",
    "personal_loan": {
      "available_credit": 2700000,
      "balance": 2300000,
      "closed_at": null,
      "interest_rate_percentage": 1.95,
      "interest_rate_source": "financial_institution",
      "interest_rate_type": "fixed",
      "last_payment_amount": 150000,
      "last_payment_date": "2024-03-15",
      "next_payment_due_date": "2024-05-15",
      "next_payment_minimum_amount": 150000,
      "opened_at": "2019-04-15",
      "original_loan_amount": 5000000,
      "sub_type": "unsecured",
      "term_length": 48
    },
    "error": null,
    "created_at": "2024-03-20T04:43:21.434Z",
    "updated_at": "2024-03-20T04:43:21.655Z"
  }
  ```

  ```json Student Loans
  {
    "id": "upt_NJK9kfjskTTCJ",
    "status": "completed",
    "account_id": "acc_uHDiQGxiR8bqc",
    "source": "snapshot",
    "type": "student_loans",
    "student_loans": {
      "balance": 12000000,
      "closed_at": null,
      "disbursements": [
        {
          "sequence": 1,
          "balance": 326300,
          "last_payment_amount": 3500,
          "last_payment_date": "2024-04-01",
          "next_payment_due_date": "2024-05-01",
          "next_payment_minimum_amount": 3500,
          "disbursed_at": "2019-08-15",
          "interest_rate_percentage": 4.29,
          "interest_rate_type": "fixed",
          "original_loan_amount": 350000,
          "term_length": 120,
          "closed_at": null,
          "interest_rate_source": "method"
        },
        {...}
      ],
      "last_payment_amount": 250000,
      "last_payment_date": "2024-03-15",
      "next_payment_due_date": "2024-05-15",
      "next_payment_minimum_amount": 250000,
      "opened_at": "2019-08-15",
      "original_loan_amount": 12000000,
      "sub_type": "federal",
      "term_length": 120
    },
    "error": null,
    "created_at": "2024-03-20T04:43:21.434Z",
    "updated_at": "2024-03-20T04:43:21.655Z"
  }
  ```
</RequestExample>


# Retrieve an Update

GET /accounts/{acc_id}/updates/{upt_id}

export const ParamList = ({items, is_child = false}) => {
  return items.map(item => {
    const field_props = {
      id: Math.random().toString(),
      body: item.name,
      name: item.name,
      type: item.type,
      required: item.required
    };
    const enums = item.enums || [];
    const items = item.items || [];
    const has_items = items?.length > 0;
    const has_enums = enums?.length > 0;
    const should_default_open = item.defaultOpen | false;
    const render_child_item = () => {
      const child_props = {
        title: has_enums ? "Possible enum values" : "properties"
      };
      if (should_default_open) child_props.defaultOpen = true;
      const has_inline_enums = has_enums && enums.every(enum_item => typeof enum_item === 'string') && enums.map((enum_item, idx) => {
        const is_last = idx === enums.length - 1;
        const is_2nd_to_last = idx === enums.length - 2;
        return <>
            <code>{enum_item}</code>
            {is_last && ''}
            {is_2nd_to_last && ' or '}
            {!is_last && !is_2nd_to_last && ', '}
          </>;
      });
      const enum_list = has_enums && !has_inline_enums && <Accordion {...child_props}>
          {enums.map(enum_item => <>
              <code>{enum_item.name}</code>
              <br />
              <p>{enum_item.description}</p>
            </>)}
        </Accordion>;
      const item_list = has_items && <Expandable {...child_props}>
          <ParamList items={items || []} is_child />
        </Expandable>;
      return <>
          <p>
            {item.description}
            {has_inline_enums && [has_inline_enums.length > 1 ? ' One of ' : ' Must be ', ...has_inline_enums]}
          </p>

          {enum_list}
          {item_list}
        </>;
    };
    return is_child ? <ResponseField {...field_props}>{render_child_item()}</ResponseField> : <ParamField {...field_props}>{render_child_item()}</ParamField>;
  });
};

Retrieves an Update record for an Account.

## Path Parameters

<ParamList
  items={[
  {
  name: 'acc_id',
  type: 'string',
  required: true,
  description: 'ID of the Account.',
  },
  {
  name: 'upt_id',
  type: 'string',
  required: true,
  description: 'ID of the Update.',
  },
  ]}
/>

## Returns

Returns an Update object.

<RequestExample>
  ```bash cURL
  curl https://production.methodfi.com/accounts/acc_aEBDiLxiR8bqc/updates/upt_NYV5kfjskTTCJ \
    -X GET \
    -H "Method-Version: 2024-04-04" \
    -H "Authorization: Bearer sk_WyZEWVfTcH7GqmPzUPk65Vjc"
  ```

  ```javascript Node.js
  const response = await method
    .accounts('acc_aEBDiLxiR8bqc')
    .updates
    .retrieve('upt_NYV5kfjskTTCJ');
  ```

  ```python Python
  response = method
    .accounts('acc_aEBDiLxiR8bqc')
    .updates
    .retrieve('upt_NYV5kfjskTTCJ')
  ```
</RequestExample>

<ResponseExample>
  ```json
  {
    "id": "upt_NYV5kfjskTTCJ",
    "status": "completed",
    "account_id": "acc_aEBDiLxiR8bqc",
    "source": "direct",
    "type": "credit_card",
    "credit_card": {
      "available_credit": 120000,
      "balance": 80000,
      "closed_at": null,
      "credit_limit": 200000,
      "interest_rate_percentage_max": 23.5,
      "interest_rate_percentage_min": 12.0,
      "interest_rate_type": "variable",
      "last_payment_amount": 5000,
      "last_payment_date": "2024-04-05",
      "next_payment_due_date": "2024-05-01",
      "next_payment_minimum_amount": 4000,
      "opened_at": "2018-10-30",
      "sub_type": "flexible_spending",
      "usage_pattern": "transactor"
    },
    "error": null,
    "created_at": "2024-03-20T04:43:21.434Z",
    "updated_at": "2024-03-20T04:43:21.655Z"
  }
  ```
</ResponseExample>


# Create a Verification

POST /accounts/{acc_id}/verification_sessions

export const ParamList = ({items, is_child = false}) => {
  return items.map(item => {
    const field_props = {
      id: Math.random().toString(),
      body: item.name,
      name: item.name,
      type: item.type,
      required: item.required
    };
    const enums = item.enums || [];
    const items = item.items || [];
    const has_items = items?.length > 0;
    const has_enums = enums?.length > 0;
    const should_default_open = item.defaultOpen | false;
    const render_child_item = () => {
      const child_props = {
        title: has_enums ? "Possible enum values" : "properties"
      };
      if (should_default_open) child_props.defaultOpen = true;
      const has_inline_enums = has_enums && enums.every(enum_item => typeof enum_item === 'string') && enums.map((enum_item, idx) => {
        const is_last = idx === enums.length - 1;
        const is_2nd_to_last = idx === enums.length - 2;
        return <>
            <code>{enum_item}</code>
            {is_last && ''}
            {is_2nd_to_last && ' or '}
            {!is_last && !is_2nd_to_last && ', '}
          </>;
      });
      const enum_list = has_enums && !has_inline_enums && <Accordion {...child_props}>
          {enums.map(enum_item => <>
              <code>{enum_item.name}</code>
              <br />
              <p>{enum_item.description}</p>
            </>)}
        </Accordion>;
      const item_list = has_items && <Expandable {...child_props}>
          <ParamList items={items || []} is_child />
        </Expandable>;
      return <>
          <p>
            {item.description}
            {has_inline_enums && [has_inline_enums.length > 1 ? ' One of ' : ' Must be ', ...has_inline_enums]}
          </p>

          {enum_list}
          {item_list}
        </>;
    };
    return is_child ? <ResponseField {...field_props}>{render_child_item()}</ResponseField> : <ParamField {...field_props}>{render_child_item()}</ParamField>;
  });
};

Creates an AccountVerificationSession of the provided type.

## Path Parameters

<ParamList
  items={[
  {
  name: 'acc_id',
  type: 'string',
  required: true,
  description: 'ID of the Account.',
  },
  ]}
/>

## Body

<ParamList
  items={[
  {
  name: 'type',
  type: 'enum',
  required: true,
  description: (
    <>
      The type of AccountVerificationSession to
      create. See <a href="/reference/accounts/verification-sessions/overview#verification-types">Verification Types.</a>
    </>
  ),
  },
  ]}
/>

## Returns

Returns an AccountVerificationSession object.

<RequestExample>
  ```bash cURL
  curl https://production.methodfi.com/accounts/acc_yVf3mkzbhz9tj/verification_sessions \
    -X POST \
    -H "Method-Version: 2024-04-04" \
    -H "Authorization: Bearer sk_WyZEWVfTcH7GqmPzUPk65Vjc" \
    -H "Content-Type: application/json" \
    -d '{
      "type": "micro_deposits"
    }'
  ```

  ```javascript Node.js
  const response = await method
    .accounts('acc_yVf3mkzbhz9tj')
    .verificationSessions
    .create({
      type: 'micro_deposits'
    });
  ```

  ```python Python
  response = method.accounts('acc_yVf3mkzbhz9tj')
    .verification_sessions
    .create({
      'type': 'micro_deposits'
    })
  ```
</RequestExample>

<ResponseExample>
  ```json Micro-deposits
  {
    "id": "avf_bxDxWqdnRcrer",
    "account_id": "acc_yVf3mkzbhz9tj",
    "status": "pending",
    "error": null,
    "type": "micro_deposits",
    "micro_deposits": {
      "amounts": []
    },
    "created_at": "2024-03-29T21:32:54.452Z",
    "updated_at": "2024-03-29T21:32:54.452Z"
  }
  ```

  ```json Plaid
  {
    "id": "avf_wYjzrmP6QBzRd",
    "account_id": "acc_yVf3mkzbhz9tj",
    "status": "pending",
    "error": null,
    "type": "plaid",
    "plaid": {
      "transactions": [],
      "balances": {}
    },
    "created_at": "2024-04-01T18:23:31.744Z",
    "updated_at": "2024-04-01T18:23:31.744Z"
  }
  ```

  ```json MX
  {
    "id": "avf_eQCXK6b7L7c3W",
    "account_id": "acc_yVf3mkzbhz9tj",
    "status": "pending",
    "error": null,
    "type": "mx",
    "mx": {
      "transactions": [],
      "account": {}
    },
    "created_at": "2024-04-01T18:24:27.003Z",
    "updated_at": "2024-04-01T18:24:27.003Z"
  }
  ```

  ```json Teller
  {
    "id": "avf_tmhN3L67Qt9N6",
    "account_id": "acc_yVf3mkzbhz9tj",
    "status": "pending",
    "error": null,
    "type": "teller",
    "teller": {
      "transactions": [],
      "balances": {}
    },
    "created_at": "2024-04-01T18:25:02.770Z",
    "updated_at": "2024-04-01T18:25:02.770Z"
  }
  ```

  ```json Standard
  {
    "id": "avf_hCUj4GhnTcekJ",
    "account_id": "acc_yVf3mkzbhz9tj",
    "status": "pending",
    "error": null,
    "type": "standard",
    "standard": {
      "number": null,
    },
    "created_at": "2024-03-14T02:02:24.862Z",
    "updated_at": "2024-03-14T02:02:24.862Z"
  }
  ```

  ```json Instant
  {
    "id": "avf_P3abzebLBXLja",
    "account_id": "acc_yVf3mkzbhz9tj",
    "status": "pending",
    "error": null,
    "type": "instant",
    "instant": {
      "exp_year": null,
      "exp_month": null,
      "exp_check": null,
      "number": "xxxxxxxxxxxxxxxx",
    },
    "created_at": "2024-03-14T02:02:24.862Z",
    "updated_at": "2024-03-14T02:02:24.862Z"
  }
  ```

  ```json Pre-auth
  {
    "id": "avf_DjkdemgTQfqRD",
    "account_id": "acc_yVf3mkzbhz9tj",
    "status": "pending",
    "error": null,
    "type": "pre_auth",
    "pre_auth": {
      "exp_year": "xxxx",
      "exp_month": "xx",
      "exp_check": null,
      "cvv": null,
      "cvv_check": null,
      "billing_zip_code": "xxxxx",
      "billing_zip_code_check": null,
      "number": "xxxxxxxxxxxxxxxx",
      "pre_auth_check": null
    },
    "created_at": "2024-03-14T02:02:24.862Z",
    "updated_at": "2024-03-14T02:02:24.862Z"
  }
  ```
</ResponseExample>


# The account verification sessions endpoint



export const get_common_parameters = (resource_name = 'resource') => {
  return {
    id: {
      name: 'id',
      type: "string",
      required: false,
      description: `Unique identifier for the ${resource_name}.`
    },
    entity_id: {
      name: 'entity_id',
      type: 'string',
      required: false,
      description: 'The ID of the associated Entity.'
    },
    account_id: {
      name: 'account_id',
      type: 'string',
      required: false,
      description: 'The ID of the associated Account.'
    },
    error: {
      name: 'error',
      type: 'object | null',
      required: false,
      description: <>
          An object representing an error that occurred while processing
          this {resource_name}. See <a href={`/reference/errors/${resource_name.replace(/^([A-Z])/, function (match) {
        return match.toLowerCase();
      }).replace(/([A-Z])/g, function (match) {
        return "-" + match.toLowerCase();
      })}-errors`}>{resource_name} errors</a>.
        </>
    },
    status_error: {
      name: 'status_error',
      type: 'object | null',
      required: false,
      description: <>
          An object representing an error that occurred while processing
          this {resource_name}. See <a href="/reference/errors/product-errors#status-errors">{resource_name} errors</a>.
        </>
    },
    metadata: {
      name: 'metadata',
      type: 'object | null',
      required: false,
      description: <>
          Additional data provided during creation.
          See <a href="/reference/metadata">metadata</a>
        </>
    },
    created_at: {
      name: 'created_at',
      type: 'string',
      required: false,
      description: `Timestamp of when the ${resource_name} was created.`
    },
    updated_at: {
      name: 'updated_at',
      type: 'string',
      required: false,
      description: `Timestamp of when the ${resource_name} was last updated.`
    },
    status: (enums = []) => ({
      name: 'status',
      type: 'enum',
      required: false,
      description: `Status of the ${resource_name}.`,
      enums
    }),
    type: (enums = []) => ({
      name: 'type',
      type: 'enum',
      required: false,
      description: `The type of ${resource_name}.`,
      enums
    })
  };
};

export const ParamList = ({items, is_child = false}) => {
  return items.map(item => {
    const field_props = {
      id: Math.random().toString(),
      body: item.name,
      name: item.name,
      type: item.type,
      required: item.required
    };
    const enums = item.enums || [];
    const items = item.items || [];
    const has_items = items?.length > 0;
    const has_enums = enums?.length > 0;
    const should_default_open = item.defaultOpen | false;
    const render_child_item = () => {
      const child_props = {
        title: has_enums ? "Possible enum values" : "properties"
      };
      if (should_default_open) child_props.defaultOpen = true;
      const has_inline_enums = has_enums && enums.every(enum_item => typeof enum_item === 'string') && enums.map((enum_item, idx) => {
        const is_last = idx === enums.length - 1;
        const is_2nd_to_last = idx === enums.length - 2;
        return <>
            <code>{enum_item}</code>
            {is_last && ''}
            {is_2nd_to_last && ' or '}
            {!is_last && !is_2nd_to_last && ', '}
          </>;
      });
      const enum_list = has_enums && !has_inline_enums && <Accordion {...child_props}>
          {enums.map(enum_item => <>
              <code>{enum_item.name}</code>
              <br />
              <p>{enum_item.description}</p>
            </>)}
        </Accordion>;
      const item_list = has_items && <Expandable {...child_props}>
          <ParamList items={items || []} is_child />
        </Expandable>;
      return <>
          <p>
            {item.description}
            {has_inline_enums && [has_inline_enums.length > 1 ? ' One of ' : ' Must be ', ...has_inline_enums]}
          </p>

          {enum_list}
          {item_list}
        </>;
    };
    return is_child ? <ResponseField {...field_props}>{render_child_item()}</ResponseField> : <ParamField {...field_props}>{render_child_item()}</ParamField>;
  });
};

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.

## AccountVerificationSession Objects

<ParamList
  items={[
  (get_common_parameters('AccountVerificationSession').id),
  (get_common_parameters('AccountVerificationSession').account_id),
  (get_common_parameters('AccountVerificationSession').status([
  {
    name: 'pending',
    description: (
      <>
        The AccountVerificationSession is pending. For <code>micro_deposits</code> type, this
        state indicates that the micro-deposit transactions have not yet been sent. For all
        other types, this means that the verification session has been created but not yet
        updated with any data.
      </>
    ),
  },
  {
    name: 'in_progress',
    description: (
      <>
        The AccountVerificationSession is in progress. For <code>micro_deposits</code> type, this
        state indicates that the micro-deposit transactions have been sent and the session can be
        updated with the amounts to complete verification. This state is irrelevant for all other types.
      </>
    ),
  },
  {
    name: 'verified',
    description: 'The AccountVerificationSession has been successfully verified.',
  },
  {
    name: 'failed',
    description: (
      <>
        The AccountVerificationSession has failed verification based on the provided
        data. See <code>error</code> for details.
      </>
    ),
  },
  ])),
  {
  name: 'type',
  type: 'enum',
  required: false,
  description: (
    <>
      The type of the AccountVerificationSession. See <a href="/reference/accounts/verification-sessions/overview#verification-types">Verification Types.</a>
    </>
  ),
  },
  {
  name: 'micro_deposits',
  type: 'object | null',
  required: false,
  description: (
    <>
      This object will be populated if the AccountVerificationSession is
      of type <code>micro_deposits</code>
    </>
  ),
  items: [
    {
      name: 'micro_deposits.amounts',
      type: 'number[]',
      required: false,
      description: 'The latest amounts that this AccountVerificationSession was updated with.',
    }
  ]
  },
  {
  name: 'plaid',
  type: 'object | null',
  required: false,
  description: (
    <>
      This object will be populated if the AccountVerificationSession is
      of type <code>plaid</code>.
    </>
  ),
  items: [
      {
          name: 'plaid.balances',
          type: 'object[]',
          description: (<>The raw balance data received from Plaid. See <a href="https://plaid.com/products/balance/#balance-data">account balances</a>.</>),
      },
      {
          name: 'plaid.transactions',
          type: 'object[]',
          description: (<>The raw transaction data received from Plaid. See <a href="https://plaid.com/products/transactions">account transactions</a>.</>),
      },
  ]
  },
  {
  name: 'mx',
  type: 'object | null',
  required: false,
  description: (
    <>
      This object will be populated if the AccountVerificationSession is
      of type <code>mx</code>.
    </>
  ),
  items: [
      {
          name: 'mx.account',
          type: "object",
          description: (<>The raw account data received from MX. See <a href="https://docs.mx.com/reference/platform-reference/reference/account-fields">account balances</a>.</>),
      },
      {
          name: 'mx.transactions',
          type: "object[]",
          description: (<>The list of the raw transaction data received from MX. See <a href="https://docs.mx.com/reference/platform-reference/reference/transaction-fields">account transactions</a>.</>),
      }
      ]
  },
  {
  name: 'teller',
  type: 'object | null',
  required: false,
  description: (
    <>
      This object will be populated if the AccountVerificationSession is
      of type <code>teller</code>.
    </>
  ),
  items: [
      {
          name: 'teller.account',
          type: "object",
          description: (<>The raw balance data received from Teller. See <a href="https://teller.io/docs/reference/account/balances#properties">account balances</a>.</>),
      },
      {
          name: 'teller.transactions',
          type: "object[]",
          description: (<>The list of the raw transaction data received from MX. See <a href="https://teller.io/docs/reference/account/transactions#properties">account transactions</a>.</>),
      },
  ]
  },
  {
  name: 'auto_verify',
  type: 'object | null',
  required: false,
  description: (
    <>
      This object will be populated if the AccountVerificationSession is
      of type <code>auto_verify</code>.
    </>
  ),
  items: [], // empty object
  },
  {
  name: 'trusted_provisioner',
  type: 'object | null',
  required: false,
  description: (
    <>
      This object will be populated if the AccountVerificationSession is
      of type <code>trusted_provisioner</code>.
    </>
  ),
  items: [],
  },
  {
  name: 'standard',
  type: 'object | null',
  required: false,
  description: (
    <>
      This object will be populated if the AccountVerificationSession is
      of type <code>standard</code>.
    </>
  ),
  items: [
    {
      name: 'standard.number',
      type: 'string | null',
      required: false,
      description: (
        <>
          The masked card number. If this is <code>null</code>, that indicates that the
          number needs to be provided for completing verification.
        </>
      )
    }
  ]
  },
  {
  name: 'pre_auth',
  type: 'object | null',
  required: false,
  description: (
    <>
      This object will be populated if the AccountVerificationSession is
      of type <code>pre_auth</code>.
    </>
  ),
  items: [
    {
      name: 'pre_auth.number',
      type: 'string | null',
      required: false,
      description: (
        <>
          The masked card number. If this is <code>null</code>, that indicates that
          the number needs to be provided for completing verification.
        </>
      )
    },
    {
      name: 'pre_auth.exp_month',
      type: 'string | null',
      required: false,
      description: (
        <>
          The masked card expiration month. If this is <code>null</code>, that indicates that
          the expiration month needs to be provided for completing verification.
        </>
      )
    },
    {
      name: 'pre_auth.exp_year',
      type: 'string | null',
      required: false,
      description: (
        <>
          The masked card expiration year. If this is <code>null</code>, that indicates that
          the expiration year needs to be provided for completing verification.
        </>
      )
    },
    {
      name: 'pre_auth.exp_check',
      type: 'enum',
      required: false,
      description: (
        <>
          The card expiration verification check result. If this is <code>fail</code>, that indicates that
          the card could not be verified given the expiration data, and the AccountVerificationSession needs
          to be updated with the correct expiration data to complete verification.
        </>
      ),
      enums: [
        {
          name: 'pass',
          description: 'The verification check passed.',
        },
        {
          name: 'fail',
          description: 'The verification check failed.',
        },
        {
          name: 'unavailable',
          description: 'The verification check is unavailable due to a restriction by the card networks.',
        },
      ],
    },
    {
      name: 'pre_auth.cvv',
      type: 'string | null',
      required: false,
      description: (
        <>
          The masked card cvv. If this is <code>null</code>, that indicates that
          the cvv needs to be provided for completing verification.
        </>
      )
    },
    {
      name: 'pre_auth.cvv_check',
      type: 'enum',
      required: false,
      description: (
        <>
          The card cvv verification check result. If this is <code>fail</code>, that indicates that
          the card could not be verified given the cvv, and the AccountVerificationSession needs to
          be updated with the correct cvv to complete verification.
        </>
      ),
      enums: [
        {
          name: 'pass',
          description: 'The verification check passed.',
        },
        {
          name: 'fail',
          description: 'The verification check failed.',
        },
        {
          name: 'unavailable',
          description: 'The verification check is unavailable due to a restriction by the card networks.',
        },
      ],
    },
    {
      name: 'pre_auth.pre_auth_check',
      type: 'enum',
      required: false,
      description: 'The pre_auth verification check result.',
      enums: [
        {
          name: 'pass',
          description: 'The verification check passed.',
        },
        {
          name: 'fail',
          description: 'The verification check failed.',
        },
        {
          name: 'unavailable',
          description: 'The verification check is unavailable due to a restriction by the card networks.',
        },
      ],
    },
  ]
  },
  (get_common_parameters('AccountVerificationSession').error),
  (get_common_parameters('AccountVerificationSession').created_at),
  (get_common_parameters('AccountVerificationSession').updated_at),
  ]}
/>

## Verification Types

| Type                  | Description                                                                                                                                                                                                                                                                     |
| --------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `micro_deposits`      | To verify a checking or savings account, two small amounts between <strong>\$0.20 - \$0.99</strong> of money will be deposited into the ACH account, once received (within 1 - 3 business days) the account holder will then verify the amounts (in cents) that were deposited. |
| `plaid`               | The ACH Account is verified by providing [balance](https://plaid.com/products/balance/#balance-data) and [transaction](https://plaid.com/products/transactions) data from Plaid.                                                                                                |
| `teller`              | The ACH Account is verified by providing [balance](https://teller.io/docs/reference/account/balances#properties) and [transaction](https://teller.io/docs/reference/account/transactions#properties) data from Teller.                                                          |
| `mx`                  | The ACH Account is verified by providing [account](https://docs.mx.com/reference/platform-reference/reference/account-fields) and [transaction](https://docs.mx.com/reference/platform-reference/reference/transaction-fields) data from MX.                                    |
| `trusted_provisioner` | The ACH Account is auto verified based on whitelisted routing numbers for the team.                                                                                                                                                                                             |
| `auto_verify`         | The ACH account is verified automatically upon creation, if this configuration is enabled for the team.                                                                                                                                                                         |
| `standard`            | The Liability Account is verified in real-time by the isuser by providing the full account/card number.                                                                                                                                                                         |
| `pre_auth`            | The Credit Card Account is verified in real-time by the issuer and card networks by providing the full card number, expiration date, and cvv.                                                                                                                                   |

## Webhook Payload

The [Webhook](/reference/webhooks/overview) payload will contain the following information:

```json
{
  "id": "string",
  "type": "account_verification_session.create" | "account_verification_session.update",
  "path": "/accounts/<acc_id>/verification_sessions/<avf_id>",
}
```

<RequestExample>
  ```json Pre-auth
  {
    "id": "avf_DjkdemgTQfqRD",
    "account_id": "acc_yVf3mkzbhz9tj",
    "status": "pending",
    "error": null,
    "type": "pre_auth",
    "pre_auth": {
      "exp_year": "xxxx",
      "exp_month": "xx",
      "exp_check": null,
      "cvv": null,
      "cvv_check": null,
      "billing_zip_code": "xxxxx",
      "billing_zip_code_check": null,
      "number": "xxxxxxxxxxxxxxxx",
      "pre_auth_check": null
    },
    "created_at": "2024-03-14T02:02:24.862Z",
    "updated_at": "2024-03-14T02:02:24.862Z"
  }
  ```

  ```json Standard
  {
    "id": "avf_hCUj4GhnTcekJ",
    "account_id": "acc_yVf3mkzbhz9tj",
    "status": "pending",
    "error": null,
    "type": "standard",
    "standard": {
      "number": null,
    },
    "created_at": "2024-03-14T02:02:24.862Z",
    "updated_at": "2024-03-14T02:02:24.862Z"
  }
  ```

  ```json Micro-deposits
  {
    "id": "avf_bxDxWqdnRcrer",
    "account_id": "acc_yVf3mkzbhz9tj",
    "status": "pending",
    "error": null,
    "type": "micro_deposits",
    "micro_deposits": {
      "amounts": []
    },
    "created_at": "2024-03-29T21:32:54.452Z",
    "updated_at": "2024-03-29T21:32:54.452Z"
  }
  ```

  ```json Plaid
  {
    "id": "avf_wYjzrmP6QBzRd",
    "account_id": "acc_yVf3mkzbhz9tj",
    "status": "pending",
    "error": null,
    "type": "plaid",
    "plaid": {
      "transactions": [],
      "balances": {}
    },
    "created_at": "2024-04-01T18:23:31.744Z",
    "updated_at": "2024-04-01T18:23:31.744Z"
  }
  ```

  ```json MX
  {
    "id": "avf_eQCXK6b7L7c3W",
    "account_id": "acc_yVf3mkzbhz9tj",
    "status": "pending",
    "error": null,
    "type": "mx",
    "mx": {
      "transactions": [],
      "account": {}
    },
    "created_at": "2024-04-01T18:24:27.003Z",
    "updated_at": "2024-04-01T18:24:27.003Z"
  }
  ```

  ```json Teller
  {
    "id": "avf_tmhN3L67Qt9N6",
    "account_id": "acc_yVf3mkzbhz9tj",
    "status": "pending",
    "error": null,
    "type": "teller",
    "teller": {
      "transactions": [],
      "balances": {}
    },
    "created_at": "2024-04-01T18:25:02.770Z",
    "updated_at": "2024-04-01T18:25:02.770Z"
  }
  ```

  ```json Trusted Provisioner
  {
    "id": "avf_zJUNmHXVGpWif",
    "account_id": "acc_yVf3mkzbhz9tj",
    "status": "pending",
    "error": null,
    "type": "trusted_provisioner",
    "trusted_provisioner": {},
    "created_at": "2024-04-01T18:25:02.770Z",
    "updated_at": "2024-04-01T18:25:02.770Z"
  }
  ```

  ```json Auto Verify
  {
    "id": "avf_zJUNmHXVGpWif",
    "account_id": "acc_yVf3mkzbhz9tj",
    "status": "pending",
    "error": null,
    "type": "auto_verify",
    "auto_verify": {},
    "created_at": "2024-04-01T18:25:02.770Z",
    "updated_at": "2024-04-01T18:25:02.770Z"
  }
  ```
</RequestExample>


# Retrieve a Verification

GET /accounts/{acc_id}/verification_sessions/{avf_id}

export const ParamList = ({items, is_child = false}) => {
  return items.map(item => {
    const field_props = {
      id: Math.random().toString(),
      body: item.name,
      name: item.name,
      type: item.type,
      required: item.required
    };
    const enums = item.enums || [];
    const items = item.items || [];
    const has_items = items?.length > 0;
    const has_enums = enums?.length > 0;
    const should_default_open = item.defaultOpen | false;
    const render_child_item = () => {
      const child_props = {
        title: has_enums ? "Possible enum values" : "properties"
      };
      if (should_default_open) child_props.defaultOpen = true;
      const has_inline_enums = has_enums && enums.every(enum_item => typeof enum_item === 'string') && enums.map((enum_item, idx) => {
        const is_last = idx === enums.length - 1;
        const is_2nd_to_last = idx === enums.length - 2;
        return <>
            <code>{enum_item}</code>
            {is_last && ''}
            {is_2nd_to_last && ' or '}
            {!is_last && !is_2nd_to_last && ', '}
          </>;
      });
      const enum_list = has_enums && !has_inline_enums && <Accordion {...child_props}>
          {enums.map(enum_item => <>
              <code>{enum_item.name}</code>
              <br />
              <p>{enum_item.description}</p>
            </>)}
        </Accordion>;
      const item_list = has_items && <Expandable {...child_props}>
          <ParamList items={items || []} is_child />
        </Expandable>;
      return <>
          <p>
            {item.description}
            {has_inline_enums && [has_inline_enums.length > 1 ? ' One of ' : ' Must be ', ...has_inline_enums]}
          </p>

          {enum_list}
          {item_list}
        </>;
    };
    return is_child ? <ResponseField {...field_props}>{render_child_item()}</ResponseField> : <ParamField {...field_props}>{render_child_item()}</ParamField>;
  });
};

Retrieve an AccountVerificationSession object by its ID.

## Path Parameters

<ParamList
  items={[
  {
  name: 'acc_id',
  type: 'string',
  required: true,
  description: 'ID of the Account.',
  },
  {
  name: 'avf_id',
  type: 'string',
  required: true,
  description: 'ID of the AccountVerificationSession.',
  },
  ]}
/>

## Returns

Returns a AccountVerificationSession object.

<RequestExample>
  ```bash cURL
  curl https://production.methodfi.com/accounts/acc_yVf3mkzbhz9tj/verification_sessions/avf_9WBBA6TH7n7iX \
    -X POST \
    -H "Method-Version: 2024-04-04" \
    -H "Authorization: Bearer sk_WyZEWVfTcH7GqmPzUPk65Vjc"
  ```

  ```javascript Node.js
  const response = await method
    .accounts('acc_yVf3mkzbhz9tj')
    .verificationSessions
    .retrieve('avf_9WBBA6TH7n7iX');
  ```

  ```python Python
  response = method
    .accounts('acc_yVf3mkzbhz9tj')
    .verification_sessions
    .retrieve('avf_9WBBA6TH7n7iX')
  ```
</RequestExample>

<ResponseExample>
  ```json
  {
    "id": "avf_DjkdemgTQfqRD",
    "status": "pending",
    "error": null,
    "type": "pre_auth",
    "pre_auth": {
        "exp_year": "xxxx",
        "exp_month": "xx",
        "exp_check": null,
        "cvv": null,
        "cvv_check": null,
        "billing_zip_code": "xxxxx",
        "billing_zip_code_check": null,
        "number": "xxxxxxxxxxxxxxxx",
        "pre_auth_check": null
    },
    "created_at": "2024-03-14T02:02:24.862Z",
    "updated_at": "2024-03-14T02:02:24.862Z"
  }
  ```
</ResponseExample>


# Update a Micro-deposits Verification

PUT /accounts/{acc_id}/verification_sessions/{avf_id}

export const ParamList = ({items, is_child = false}) => {
  return items.map(item => {
    const field_props = {
      id: Math.random().toString(),
      body: item.name,
      name: item.name,
      type: item.type,
      required: item.required
    };
    const enums = item.enums || [];
    const items = item.items || [];
    const has_items = items?.length > 0;
    const has_enums = enums?.length > 0;
    const should_default_open = item.defaultOpen | false;
    const render_child_item = () => {
      const child_props = {
        title: has_enums ? "Possible enum values" : "properties"
      };
      if (should_default_open) child_props.defaultOpen = true;
      const has_inline_enums = has_enums && enums.every(enum_item => typeof enum_item === 'string') && enums.map((enum_item, idx) => {
        const is_last = idx === enums.length - 1;
        const is_2nd_to_last = idx === enums.length - 2;
        return <>
            <code>{enum_item}</code>
            {is_last && ''}
            {is_2nd_to_last && ' or '}
            {!is_last && !is_2nd_to_last && ', '}
          </>;
      });
      const enum_list = has_enums && !has_inline_enums && <Accordion {...child_props}>
          {enums.map(enum_item => <>
              <code>{enum_item.name}</code>
              <br />
              <p>{enum_item.description}</p>
            </>)}
        </Accordion>;
      const item_list = has_items && <Expandable {...child_props}>
          <ParamList items={items || []} is_child />
        </Expandable>;
      return <>
          <p>
            {item.description}
            {has_inline_enums && [has_inline_enums.length > 1 ? ' One of ' : ' Must be ', ...has_inline_enums]}
          </p>

          {enum_list}
          {item_list}
        </>;
    };
    return is_child ? <ResponseField {...field_props}>{render_child_item()}</ResponseField> : <ParamField {...field_props}>{render_child_item()}</ParamField>;
  });
};

Updates an existing AccountVerificationSession object of type `micro_deposits`.

<Note>
  Amounts should be attempted once the AccountVerificationSession status
  is <code>in\_progress</code>, indicating that the micro-deposit transactions
  have been sent.
</Note>

## Path Parameters

<ParamList
  items={[
  {
  name: 'acc_id',
  type: 'string',
  required: true,
  description: 'ID of the Account.',
  },
  {
  name: 'avf_id',
  type: 'string',
  required: true,
  description: 'ID of the AccountVerificationSession.',
  },
  ]}
/>

## Body

<ParamList
  items={[
  {
  name: 'micro_deposits',
  type: 'object',
  required: true,
  description: '',
  items: [
    {
      name: 'micro_deposits.amounts',
      type: 'array',
      required: true,
      description: (<>The amounts of the micro-deposit transactions.</>),
    }
  ],
  },
  ]}
/>

## Returns

Returns an AccountVerificationSession object.

<RequestExample>
  ```bash cURL
  curl https://production.methodfi.com/accounts/acc_yVf3mkzbhz9tj/verification_sessions/avf_yBQQNKmjRBTqF \
    -X PUT \
    -H "Method-Version: 2024-04-04" \
    -H "Authorization: Bearer sk_WyZEWVfTcH7GqmPzUPk65Vjc" \
    -H "Content-Type: application/json" \
    -d '{
      "micro_deposits": {
        "amounts": [10, 34]
    }'
  ```

  ```javascript Node.js
  const response = await method
    .accounts('acc_yVf3mkzbhz9tj')
    .verificationSessions
    .update('avf_yBQQNKmjRBTqF', {
      micro_deposits: {
        amounts: [10, 34]
      }
    });
  ```

  ```python Python
  response = method
    .accounts('acc_yVf3mkzbhz9tj')
    .verification_sessions
    .update('avf_yBQQNKmjRBTqF', {
      'micro_deposits': {
        'amounts': [10, 34]
      }
    })
  ```
</RequestExample>

<ResponseExample>
  ```json
  {
    "id": "avf_yBQQNKmjRBTqF",
    "account_id": "acc_yVf3mkzbhz9tj",
    "status": "verified",
    "error": null,
    "type": "micro_deposits",
    "micro_deposits": {
        "amounts": [
            10,
            34
        ]
    },
    "created_at": "2024-03-14T02:02:24.862Z",
    "updated_at": "2024-03-14T02:02:24.862Z"
  }
  ```
</ResponseExample>


# Update an MX Verification

PUT /accounts/{acc_id}/verification_sessions/{avf_id}

export const ParamList = ({items, is_child = false}) => {
  return items.map(item => {
    const field_props = {
      id: Math.random().toString(),
      body: item.name,
      name: item.name,
      type: item.type,
      required: item.required
    };
    const enums = item.enums || [];
    const items = item.items || [];
    const has_items = items?.length > 0;
    const has_enums = enums?.length > 0;
    const should_default_open = item.defaultOpen | false;
    const render_child_item = () => {
      const child_props = {
        title: has_enums ? "Possible enum values" : "properties"
      };
      if (should_default_open) child_props.defaultOpen = true;
      const has_inline_enums = has_enums && enums.every(enum_item => typeof enum_item === 'string') && enums.map((enum_item, idx) => {
        const is_last = idx === enums.length - 1;
        const is_2nd_to_last = idx === enums.length - 2;
        return <>
            <code>{enum_item}</code>
            {is_last && ''}
            {is_2nd_to_last && ' or '}
            {!is_last && !is_2nd_to_last && ', '}
          </>;
      });
      const enum_list = has_enums && !has_inline_enums && <Accordion {...child_props}>
          {enums.map(enum_item => <>
              <code>{enum_item.name}</code>
              <br />
              <p>{enum_item.description}</p>
            </>)}
        </Accordion>;
      const item_list = has_items && <Expandable {...child_props}>
          <ParamList items={items || []} is_child />
        </Expandable>;
      return <>
          <p>
            {item.description}
            {has_inline_enums && [has_inline_enums.length > 1 ? ' One of ' : ' Must be ', ...has_inline_enums]}
          </p>

          {enum_list}
          {item_list}
        </>;
    };
    return is_child ? <ResponseField {...field_props}>{render_child_item()}</ResponseField> : <ParamField {...field_props}>{render_child_item()}</ParamField>;
  });
};

Updates an existing AccountVerificationSession object of type `mx`.

## Path Parameters

<ParamList
  items={[
  {
  name: 'acc_id',
  type: 'string',
  required: true,
  description: 'ID of the Account.',
  },
  {
  name: 'avf_id',
  type: 'string',
  required: true,
  description: 'ID of the AccountVerificationSession.',
  },
  ]}
/>

## Body

<ParamList
  items={[
  {
  name: 'mx',
  type: 'object',
  required: true,
  description: '',
  items: [
    {
      name: 'mx.account',
      type: "object",
      required: true,
      description: (<>The raw account data received from MX. See <a href="https://docs.mx.com/reference/platform-reference/reference/account-fields">account balances</a>.</>),
    },
    {
      name: 'mx.transactions',
      type: "object[]",
      required: true,
      description: (<>The list of the raw transaction data received from MX. See <a href="https://docs.mx.com/reference/platform-reference/reference/transaction-fields">account transactions</a>.</>),
    },
  ],
  },
  ]}
/>

## Returns

Returns an AccountVerificationSession object.

<RequestExample>
  ```bash cURL
  curl https://production.methodfi.com/accounts/acc_yVf3mkzbhz9tj/verification_sessions/avf_DjkdemgTQfqRD \
    -X PUT \
    -H "Method-Version: 2024-04-04" \
    -H "Authorization: Bearer sk_WyZEWVfTcH7GqmPzUPk65Vjc" \
    -H "Content-Type: application/json" \
    -d '{
      "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": [
          ...
        ]
    }'
  ```

  ```javascript Node.js
  const response = await method
    .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: [
          ...
        ]
      }
    });
  ```

  ```python Python
  response = method
    .accounts('acc_yVf3mkzbhz9tj')
    .verification_sessions
    .update('avf_DjkdemgTQfqRD', {
      'mx': {
        'account': {
          'institution_code': 'chase',
          'guid': 'ACT-06d7f44b-caae-0f6e-1384-01f52e75dcb1',
          'account_number': None,
          'apr': None,
          'apy': None,
          'available_balance': 1000.23,
          'available_credit': None,
          'balance': 1000.23,
          'cash_balance': 1000.32,
          'cash_surrender_value': 1000.23,
          'created_at': '2016-10-13T17:57:37+00:00',
          ...
        },
        'transactions': [
          ...
        ]
      }
    })
  ```
</RequestExample>

<ResponseExample>
  ```json
  {
    "id": "avf_DjkdemgTQfqRD",
    "account_id": "acc_yVf3mkzbhz9tj",
    "status": "verified",
    "error": null,
    "type": "mx",
    "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": [ ... ]
    },
    "created_at": "2024-03-14T02:02:24.862Z",
    "updated_at": "2024-03-14T02:02:24.862Z"
  }
  ```
</ResponseExample>


# Update a Plaid Verification

PUT /accounts/{acc_id}/verification_sessions/{avf_id}

export const ParamList = ({items, is_child = false}) => {
  return items.map(item => {
    const field_props = {
      id: Math.random().toString(),
      body: item.name,
      name: item.name,
      type: item.type,
      required: item.required
    };
    const enums = item.enums || [];
    const items = item.items || [];
    const has_items = items?.length > 0;
    const has_enums = enums?.length > 0;
    const should_default_open = item.defaultOpen | false;
    const render_child_item = () => {
      const child_props = {
        title: has_enums ? "Possible enum values" : "properties"
      };
      if (should_default_open) child_props.defaultOpen = true;
      const has_inline_enums = has_enums && enums.every(enum_item => typeof enum_item === 'string') && enums.map((enum_item, idx) => {
        const is_last = idx === enums.length - 1;
        const is_2nd_to_last = idx === enums.length - 2;
        return <>
            <code>{enum_item}</code>
            {is_last && ''}
            {is_2nd_to_last && ' or '}
            {!is_last && !is_2nd_to_last && ', '}
          </>;
      });
      const enum_list = has_enums && !has_inline_enums && <Accordion {...child_props}>
          {enums.map(enum_item => <>
              <code>{enum_item.name}</code>
              <br />
              <p>{enum_item.description}</p>
            </>)}
        </Accordion>;
      const item_list = has_items && <Expandable {...child_props}>
          <ParamList items={items || []} is_child />
        </Expandable>;
      return <>
          <p>
            {item.description}
            {has_inline_enums && [has_inline_enums.length > 1 ? ' One of ' : ' Must be ', ...has_inline_enums]}
          </p>

          {enum_list}
          {item_list}
        </>;
    };
    return is_child ? <ResponseField {...field_props}>{render_child_item()}</ResponseField> : <ParamField {...field_props}>{render_child_item()}</ParamField>;
  });
};

Updates an existing AccountVerificationSession object of type `plaid`.

## Path Parameters

<ParamList
  items={[
  {
  name: 'acc_id',
  type: 'string',
  required: true,
  description: 'ID of the Account.',
  },
  {
  name: 'avf_id',
  type: 'string',
  required: true,
  description: 'ID of the AccountVerificationSession.',
  },
  ]}
/>

## Body

<ParamList
  items={[
  {
  name: 'plaid',
  type: 'object',
  required: true,
  description: '',
  items: [
    {
      name: 'plaid.balances',
      type: 'object[]',
      required: true,
      description: (<>The raw balance data received from Plaid. See <a href="https://plaid.com/products/balance/#balance-data">account balances</a>.</>),
    },
    {
      name: 'plaid.transactions',
      type: 'object[]',
      required: true,
      description: (<>The raw transaction data received from Plaid. See <a href="https://plaid.com/products/transactions">account transactions</a>.</>),
    },
  ],
  },
  ]}
/>

## Returns

Returns an AccountVerificationSession object.

<RequestExample>
  ```bash cURL
  curl https://production.methodfi.com/accounts/acc_yVf3mkzbhz9tj/verification_sessions/avf_DjkdemgTQfqRD \
    -X PUT \
    -H "Method-Version: 2024-04-04" \
    -H "Authorization: Bearer sk_WyZEWVfTcH7GqmPzUPk65Vjc" \
    -H "Content-Type: application/json" \
    -d '{
      "plaid": {
        "balances" : {
          "available" : 100,
          "current" : 110,
          "iso_currency_code" : "USD",
          "limit" : null,
          "unofficial_currency_code" : null
        },
        "transactions": [
          ...
        ]
    }'
  ```

  ```javascript Node.js
  const response = await method
    .accounts('acc_yVf3mkzbhz9tj')
    .verificationSessions
    .update('avf_DjkdemgTQfqRD', {
      plaid: {
        balances: {
          available: 100,
          current: 110,
          iso_currency_code: 'USD',
          limit: null,
          unofficial_currency_code: null
        },
        transactions: [
          ...
        ]
      }
    });
  ```

  ```python Python
  response = method
    .accounts('acc_yVf3mkzbhz9tj')
    .verification_sessions
    .update('avf_DjkdemgTQfqRD', {
      'plaid': {
        'balances': {
          'available': 100,
          'current': 110,
          'iso_currency_code': 'USD',
          'limit': None,
          'unofficial_currency_code': None
        },
        'transactions': [
          ...
        ]
      }
    })
  ```
</RequestExample>

<ResponseExample>
  ```json
  {
    "id": "avf_DjkdemgTQfqRD",
    "account_id": "acc_yVf3mkzbhz9tj",
    "status": "verified",
    "error": null,
    "type": "plaid",
    "plaid": {
      "balances": {
        "available": 100,
        "current": 110,
        "iso_currency_code": "USD",
        "limit": null,
        "unofficial_currency_code": null,
      },
      "transactions": [ ... ]
    },
    "created_at": "2024-03-14T02:02:24.862Z",
    "updated_at": "2024-03-14T02:02:24.862Z"
  }
  ```
</ResponseExample>


# Update a Pre-auth Verification

PUT /accounts/{acc_id}/verification_sessions/{avf_id}

export const ParamList = ({items, is_child = false}) => {
  return items.map(item => {
    const field_props = {
      id: Math.random().toString(),
      body: item.name,
      name: item.name,
      type: item.type,
      required: item.required
    };
    const enums = item.enums || [];
    const items = item.items || [];
    const has_items = items?.length > 0;
    const has_enums = enums?.length > 0;
    const should_default_open = item.defaultOpen | false;
    const render_child_item = () => {
      const child_props = {
        title: has_enums ? "Possible enum values" : "properties"
      };
      if (should_default_open) child_props.defaultOpen = true;
      const has_inline_enums = has_enums && enums.every(enum_item => typeof enum_item === 'string') && enums.map((enum_item, idx) => {
        const is_last = idx === enums.length - 1;
        const is_2nd_to_last = idx === enums.length - 2;
        return <>
            <code>{enum_item}</code>
            {is_last && ''}
            {is_2nd_to_last && ' or '}
            {!is_last && !is_2nd_to_last && ', '}
          </>;
      });
      const enum_list = has_enums && !has_inline_enums && <Accordion {...child_props}>
          {enums.map(enum_item => <>
              <code>{enum_item.name}</code>
              <br />
              <p>{enum_item.description}</p>
            </>)}
        </Accordion>;
      const item_list = has_items && <Expandable {...child_props}>
          <ParamList items={items || []} is_child />
        </Expandable>;
      return <>
          <p>
            {item.description}
            {has_inline_enums && [has_inline_enums.length > 1 ? ' One of ' : ' Must be ', ...has_inline_enums]}
          </p>

          {enum_list}
          {item_list}
        </>;
    };
    return is_child ? <ResponseField {...field_props}>{render_child_item()}</ResponseField> : <ParamField {...field_props}>{render_child_item()}</ParamField>;
  });
};

Updates an existing AccountVerificationSession object of type `pre_auth`.

<Note>
  Only fields for which the value is <code>null</code> or the
  associated <code>\*\_check</code> value is <code>fail</code> should be provided
  in the update request.
</Note>

<Warning>The Pre-Auth Verification type is restricted to most teams, and requires PCI compliance to access.
Contact your Method CSM for more information.</Warning>

## Path Parameters

<ParamList
  items={[
  {
  name: 'acc_id',
  type: 'string',
  required: true,
  description: 'ID of the Account.',
  },
  {
  name: 'avf_id',
  type: 'string',
  required: true,
  description: 'ID of the AccountVerificationSession.',
  },
  ]}
/>

## Body

<ParamList
  items={[
  {
  name: 'pre_auth',
  type: 'object',
  required: true,
  description: '',
  items: [
    {
      name: 'pre_auth.number',
      type: 'string',
      required: false,
      description: (<>The card number. This will be required to verify the account if the number on the AccountVerificationSession object is <code>null</code></>),
    },
    {
      name: 'pre_auth.exp_month',
      type: 'string',
      required: false,
      description: (<>The card expiration month. This will be required to verify the account if the expiration month on the AccountVerificationSession object is <code>null</code>
      or the <code>exp_check</code> field is <code>fail</code></>),
    },
    {
      name: 'pre_auth.exp_year',
      type: 'string',
      required: false,
      description: (<>The card expiration year. This will be required to verify the account if the expiration year on the AccountVerificationSession object is <code>null</code>
      or the <code>exp_check</code> field is <code>fail</code></>),
    },
    {
      name: 'pre_auth.cvv',
      type: 'string',
      required: false,
      description: (<>The card cvv code. This will be required to verify the account if the cvv on the AccountVerificationSession object is <code>null</code>
      or the <code>cvv_check</code> field is <code>fail</code></>),
    },
  ],
  },
  ]}
/>

## Returns

Returns an AccountVerificationSession object.

<RequestExample>
  ```bash cURL
  curl https://production.methodfi.com/accounts/acc_yVf3mkzbhz9tj/verification_sessions/avf_DjkdemgTQfqRD \
    -X PUT \
    -H "Method-Version: 2024-04-04" \
    -H "Authorization: Bearer sk_WyZEWVfTcH7GqmPzUPk65Vjc" \
    -H "Content-Type: application/json" \
    -d '{
      "pre_auth": {
        "cvv": "031",
      }
    }'
  ```

  ```javascript Node.js
  const response = await method
    .accounts('acc_yVf3mkzbhz9tj')
    .verificationSessions
    .update('avf_DjkdemgTQfqRD', {
      pre_auth: {
        cvv: '031'
      }
    });
  ```

  ```python Python
  response = method
    .accounts('acc_yVf3mkzbhz9tj')
    .verification_sessions
    .update('avf_DjkdemgTQfqRD', {
      'pre_auth': {
        'cvv': '031'
      }
    })
  ```
</RequestExample>

<ResponseExample>
  ```json
  {
    "id": "avf_DjkdemgTQfqRD",
    "account_id": "acc_yVf3mkzbhz9tj",
    "status": "verified",
    "error": null,
    "type": "pre_auth",
    "pre_auth": {
      "exp_year": "xxxx",
      "exp_month": "xx",
      "exp_check": "pass",
      "cvv": "xxx",
      "cvv_check": "pass",
      "billing_zip_code": "xxxxx",
      "billing_zip_code_check": "pass",
      "number": "xxxxxxxxxxxxxxxx",
      "pre_auth_check": "pass"
    },
    "created_at": "2024-03-14T02:02:24.862Z",
    "updated_at": "2024-03-14T02:02:24.862Z"
  }
  ```
</ResponseExample>


# Update a Standard Verification

PUT /accounts/{acc_id}/verification_sessions/{avf_id}

export const ParamList = ({items, is_child = false}) => {
  return items.map(item => {
    const field_props = {
      id: Math.random().toString(),
      body: item.name,
      name: item.name,
      type: item.type,
      required: item.required
    };
    const enums = item.enums || [];
    const items = item.items || [];
    const has_items = items?.length > 0;
    const has_enums = enums?.length > 0;
    const should_default_open = item.defaultOpen | false;
    const render_child_item = () => {
      const child_props = {
        title: has_enums ? "Possible enum values" : "properties"
      };
      if (should_default_open) child_props.defaultOpen = true;
      const has_inline_enums = has_enums && enums.every(enum_item => typeof enum_item === 'string') && enums.map((enum_item, idx) => {
        const is_last = idx === enums.length - 1;
        const is_2nd_to_last = idx === enums.length - 2;
        return <>
            <code>{enum_item}</code>
            {is_last && ''}
            {is_2nd_to_last && ' or '}
            {!is_last && !is_2nd_to_last && ', '}
          </>;
      });
      const enum_list = has_enums && !has_inline_enums && <Accordion {...child_props}>
          {enums.map(enum_item => <>
              <code>{enum_item.name}</code>
              <br />
              <p>{enum_item.description}</p>
            </>)}
        </Accordion>;
      const item_list = has_items && <Expandable {...child_props}>
          <ParamList items={items || []} is_child />
        </Expandable>;
      return <>
          <p>
            {item.description}
            {has_inline_enums && [has_inline_enums.length > 1 ? ' One of ' : ' Must be ', ...has_inline_enums]}
          </p>

          {enum_list}
          {item_list}
        </>;
    };
    return is_child ? <ResponseField {...field_props}>{render_child_item()}</ResponseField> : <ParamField {...field_props}>{render_child_item()}</ParamField>;
  });
};

Updates an existing AccountVerificationSession object of type `standard`.

<Warning>The Standard Verification type is restricted to most teams, and requires PCI compliance to access.
Contact your Method CSM for more information.</Warning>

## Path Parameters

<ParamList
  items={[
  {
  name: 'acc_id',
  type: 'string',
  required: true,
  description: 'ID of the Account.',
  },
  {
  name: 'avf_id',
  type: 'string',
  required: true,
  description: 'ID of the AccountVerificationSession.',
  },
  ]}
/>

## Body

<ParamList
  items={[
  {
  name: 'standard',
  type: 'object',
  required: true,
  description: '',
  items: [
    {
      name: 'standard.number',
      type: 'string',
      required: false,
      description: (<>The card number. This will be required to verify the account if the number on the AccountVerificationSession object is <code>null</code></>),
    },
  ],
  },
  ]}
/>

## Returns

Returns an AccountVerificationSession object.

<RequestExample>
  ```bash cURL
  curl https://production.methodfi.com/accounts/acc_yVf3mkzbhz9tj/verification_sessions/avf_DjkdemgTQfqRD \
    -X PUT \
    -H "Method-Version: 2024-04-04" \
    -H "Authorization: Bearer sk_WyZEWVfTcH7GqmPzUPk65Vjc" \
    -H "Content-Type: application/json" \
    -d '{
      "standard": {
        "number": "4111111111111111",
      }
    }'
  ```

  ```javascript Node.js
  const response = await method
    .accounts('acc_yVf3mkzbhz9tj')
    .verificationSessions
    .update('avf_DjkdemgTQfqRD', {
      standard: {
        number: '4111111111111111',
      }
    });
  ```

  ```python Python
  response = method
    .accounts('acc_yVf3mkzbhz9tj')
    .verification_sessions
    .update('avf_DjkdemgTQfqRD', {
      'standard': {
        'number': '4111111111111111',
      }
    })
  ```
</RequestExample>

<ResponseExample>
  ```json
  {
    "id": "avf_DjkdemgTQfqRD",
    "account_id": "acc_yVf3mkzbhz9tj",
    "status": "verified",
    "error": null,
    "type": "standard",
    "standard": {
      "number": "xxxxxxxxxxxxxxxx",
    },
    "created_at": "2024-03-14T02:02:24.862Z",
    "updated_at": "2024-03-14T02:02:24.862Z"
  }
  ```
</ResponseExample>


# Update a Teller Verification

PUT /accounts/{acc_id}/verification_sessions/{avf_id}

export const ParamList = ({items, is_child = false}) => {
  return items.map(item => {
    const field_props = {
      id: Math.random().toString(),
      body: item.name,
      name: item.name,
      type: item.type,
      required: item.required
    };
    const enums = item.enums || [];
    const items = item.items || [];
    const has_items = items?.length > 0;
    const has_enums = enums?.length > 0;
    const should_default_open = item.defaultOpen | false;
    const render_child_item = () => {
      const child_props = {
        title: has_enums ? "Possible enum values" : "properties"
      };
      if (should_default_open) child_props.defaultOpen = true;
      const has_inline_enums = has_enums && enums.every(enum_item => typeof enum_item === 'string') && enums.map((enum_item, idx) => {
        const is_last = idx === enums.length - 1;
        const is_2nd_to_last = idx === enums.length - 2;
        return <>
            <code>{enum_item}</code>
            {is_last && ''}
            {is_2nd_to_last && ' or '}
            {!is_last && !is_2nd_to_last && ', '}
          </>;
      });
      const enum_list = has_enums && !has_inline_enums && <Accordion {...child_props}>
          {enums.map(enum_item => <>
              <code>{enum_item.name}</code>
              <br />
              <p>{enum_item.description}</p>
            </>)}
        </Accordion>;
      const item_list = has_items && <Expandable {...child_props}>
          <ParamList items={items || []} is_child />
        </Expandable>;
      return <>
          <p>
            {item.description}
            {has_inline_enums && [has_inline_enums.length > 1 ? ' One of ' : ' Must be ', ...has_inline_enums]}
          </p>

          {enum_list}
          {item_list}
        </>;
    };
    return is_child ? <ResponseField {...field_props}>{render_child_item()}</ResponseField> : <ParamField {...field_props}>{render_child_item()}</ParamField>;
  });
};

Updates an existing AccountVerificationSession object of type `teller`.

## Path Parameters

<ParamList
  items={[
  {
  name: 'acc_id',
  type: 'string',
  required: true,
  description: 'ID of the Account.',
  },
  {
  name: 'avf_id',
  type: 'string',
  required: true,
  description: 'ID of the AccountVerificationSession.',
  },
  ]}
/>

## Body

<ParamList
  items={[
  {
  name: 'teller',
  type: 'object',
  required: true,
  description: '',
  items: [
    {
      name: 'teller.account',
      type: "object",
      required: true,
      description: (<>The raw balance data received from Teller. See <a href="https://teller.io/docs/reference/account/balances#properties">account balances</a>.</>),
    },
    {
      name: 'teller.transactions',
      type: "object[]",
      required: true,
      description: (<>The list of the raw transaction data received from MX. See <a href="https://teller.io/docs/reference/account/transactions#properties">account transactions</a>.</>),
    },
  ],
  },
  ]}
/>

## Returns

Returns an AccountVerificationSession object.

<RequestExample>
  ```bash cURL
  curl https://production.methodfi.com/accounts/acc_yVf3mkzbhz9tj/verification_sessions/avf_DjkdemgTQfqRD \
    -X PUT \
    -H "Method-Version: 2024-04-04" \
    -H "Authorization: Bearer sk_WyZEWVfTcH7GqmPzUPk65Vjc" \
    -H "Content-Type: application/json" \
    -d '{
      "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": [
          ...
        ]
    }'
  ```

  ```javascript Node.js
  const response = await method
    .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: [
          ...
        ]
      }
    });
  ```

  ```python Python
  response = method
    .accounts('acc_yVf3mkzbhz9tj')
    .verification_sessions
    .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': [
          ...
        ]
      }
    })
  ```
</RequestExample>

<ResponseExample>
  ```json
  {
    "id": "avf_DjkdemgTQfqRD",
    "account_id": "acc_yVf3mkzbhz9tj",
    "status": "verified",
    "error": null,
    "type": "teller",
    "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": [ ... ]
    },
    "created_at": "2024-03-14T02:02:24.862Z",
    "updated_at": "2024-03-14T02:02:24.862Z"
  }
  ```
</ResponseExample>


# Authentication



The Method API uses API keys to authenticate requests. The API key serves as an identifier for your team.
Secret API keys for your team have the prefix `sk_`

Your team's API Key has to be included as Bearer token in the `Authorization` header of a request.

#### Get an Access Token

👉 Get started by creating your account in the [Method Dashboard](https://dashboard.methodfi.com) or
[connect](https://methodfi.com/contact-us) with our team. We cannot wait to see what you'll build!

<RequestExample>
  ```bash cURL
  curl https://production.methodfi.com/accounts \
    -H "Method-Version: 2024-04-04" \
    -H "Authorization: Bearer sk_WyZEWVfTcH7GqmPzUPk65Vjc"
  ```

  ```javascript Node.js
  const { Method, Environments } = require('method-node');

  const method = new Method({
    apiKey: 'sk_WyZEWVfTcH7GqmPzUPk65Vjc',
    env: Environments.production,
  });

  const accounts = await method.accounts.list();
  ```

  ```python Python
  from method import Method

  method = Method(env='production', api_key='sk_WyZEWVfTcH7GqmPzUPk65Vjc')

  accounts = method.accounts.list()
  ```
</RequestExample>


# The element endpoint



export const ExpandableFieldsList = ({resource_type}) => {
  const ExpandableFieldsByResourceType = {
    entity: ['connect', 'credit_score'],
    account: ['sensitive', 'balance', 'card_brand', 'payoff', 'transactions', 'update', 'latest_verification_session']
  };
  const ExpandableFieldsNameToValues = {
    connect: {
      key_name: 'connect',
      object_name: 'Connect'
    },
    credit_score: {
      key_name: 'credit_score',
      object_name: 'CreditScore'
    },
    sensitive: {
      key_name: 'sensitive',
      object_name: 'Sensitive'
    },
    balance: {
      key_name: 'balance',
      object_name: 'Balance'
    },
    card_brand: {
      key_name: 'card_brand',
      object_name: 'CardBrand'
    },
    payoff: {
      key_name: 'payoff',
      object_name: 'Payoff'
    },
    transactions: {
      key_name: 'transactions',
      object_name: 'Transaction'
    },
    update: {
      key_name: 'update',
      object_name: 'Update'
    },
    latest_verification_session: {
      key_name: 'latest_verification_session',
      object_name: 'AccountVerificationSession'
    }
  };
  const ExpandableFields = field_name => <ParamField body={ExpandableFieldsNameToValues[field_name].key_name} type="string | null">
        <>
          ID of the {ExpandableFieldsNameToValues[field_name].object_name} record.{" "}
          <Tooltip tip="This can be expanded into an object with the expand query parameter.">
            <a href="/reference/expanding">Expandable</a>
          </Tooltip>.
        </>
    </ParamField>;
  return ExpandableFieldsByResourceType[resource_type].map(field_name => {
    return ExpandableFields(field_name);
  });
};

export const ParamList = ({items, is_child = false}) => {
  return items.map(item => {
    const field_props = {
      id: Math.random().toString(),
      body: item.name,
      name: item.name,
      type: item.type,
      required: item.required
    };
    const enums = item.enums || [];
    const items = item.items || [];
    const has_items = items?.length > 0;
    const has_enums = enums?.length > 0;
    const should_default_open = item.defaultOpen | false;
    const render_child_item = () => {
      const child_props = {
        title: has_enums ? "Possible enum values" : "properties"
      };
      if (should_default_open) child_props.defaultOpen = true;
      const has_inline_enums = has_enums && enums.every(enum_item => typeof enum_item === 'string') && enums.map((enum_item, idx) => {
        const is_last = idx === enums.length - 1;
        const is_2nd_to_last = idx === enums.length - 2;
        return <>
            <code>{enum_item}</code>
            {is_last && ''}
            {is_2nd_to_last && ' or '}
            {!is_last && !is_2nd_to_last && ', '}
          </>;
      });
      const enum_list = has_enums && !has_inline_enums && <Accordion {...child_props}>
          {enums.map(enum_item => <>
              <code>{enum_item.name}</code>
              <br />
              <p>{enum_item.description}</p>
            </>)}
        </Accordion>;
      const item_list = has_items && <Expandable {...child_props}>
          <ParamList items={items || []} is_child />
        </Expandable>;
      return <>
          <p>
            {item.description}
            {has_inline_enums && [has_inline_enums.length > 1 ? ' One of ' : ' Must be ', ...has_inline_enums]}
          </p>

          {enum_list}
          {item_list}
        </>;
    };
    return is_child ? <ResponseField {...field_props}>{render_child_item()}</ResponseField> : <ParamField {...field_props}>{render_child_item()}</ParamField>;
  });
};

Method Elements is a collection of embeddable UI components that make it easy to integrate Method's API into your experience. Using Method Elements, you can securely identify your users, connect their liabilites, and move money across accounts.

For more information about using Elements, see the [Elements Overview](/elements/overview).

<RequestExample>
  ```json ELEMENT RESULTS OBJECT
  {
    "authenticated": true,
    "cxn_id": "cxn_xr86xHEcWmpmB",
    "accounts": [
      "acc_jPXLFqd6KzH3N",
      "acc_DALLeLrj3TH8h"
    ],
    "entity_id": "ent_GWKYtnFyE79db",
    "events": [
      {
        "type": "open",
        "metadata": {
          "element_type": "connect",
          "op": "open"
        },
        "timestamp": "2024-04-25T02:35:28.097Z"
      },
      {
        "type": "success",
        "metadata": {
          "entity_id": "ent_GWKYtnFyE79db",
          "accounts": [
            "acc_jPXLFqd6KzH3N",
            "acc_DALLeLrj3TH8h"
          ],
          "element_type": "connect",
          "op": "success"
        },
        "timestamp": "2024-04-25T02:35:57.120Z"
      },
      {
        "type": "exit",
        "metadata": {
          "element_type": "connect",
          "op": "exit"
        },
        "timestamp": "2024-04-25T02:35:57.138Z"
      }
    ]
  }
  ```
</RequestExample>


# Retrieve Element Results

GET /elements/token/{pk_elem_id}/results

export const ParamList = ({items, is_child = false}) => {
  return items.map(item => {
    const field_props = {
      id: Math.random().toString(),
      body: item.name,
      name: item.name,
      type: item.type,
      required: item.required
    };
    const enums = item.enums || [];
    const items = item.items || [];
    const has_items = items?.length > 0;
    const has_enums = enums?.length > 0;
    const should_default_open = item.defaultOpen | false;
    const render_child_item = () => {
      const child_props = {
        title: has_enums ? "Possible enum values" : "properties"
      };
      if (should_default_open) child_props.defaultOpen = true;
      const has_inline_enums = has_enums && enums.every(enum_item => typeof enum_item === 'string') && enums.map((enum_item, idx) => {
        const is_last = idx === enums.length - 1;
        const is_2nd_to_last = idx === enums.length - 2;
        return <>
            <code>{enum_item}</code>
            {is_last && ''}
            {is_2nd_to_last && ' or '}
            {!is_last && !is_2nd_to_last && ', '}
          </>;
      });
      const enum_list = has_enums && !has_inline_enums && <Accordion {...child_props}>
          {enums.map(enum_item => <>
              <code>{enum_item.name}</code>
              <br />
              <p>{enum_item.description}</p>
            </>)}
        </Accordion>;
      const item_list = has_items && <Expandable {...child_props}>
          <ParamList items={items || []} is_child />
        </Expandable>;
      return <>
          <p>
            {item.description}
            {has_inline_enums && [has_inline_enums.length > 1 ? ' One of ' : ' Must be ', ...has_inline_enums]}
          </p>

          {enum_list}
          {item_list}
        </>;
    };
    return is_child ? <ResponseField {...field_props}>{render_child_item()}</ResponseField> : <ParamField {...field_props}>{render_child_item()}</ParamField>;
  });
};

Returns results and metadata for a given Element token.

## Path Parameters

<ParamList
  items={[
  {
  name: 'pk_elem_id',
  type: 'string',
  required: true,
  description: 'ID of the Element token.',
  },
  ]}
/>

## Returns

Returns information about the Element token and session.

<RequestExample>
  ```bash cURL
  curl https://production.methodfi.com/elements/token/pk_elem_dDe4r9M6X3Ad9zjpbgYpzLNtRCXfhPYR/results \
    -X GET \
    -H "Method-Version: 2024-04-04" \
    -H "Authorization: Bearer sk_WyZEWVfTcH7GqmPzUPk65Vjc"
  ```

  ```javascript Node.js
  const response = await method
    .elements
    .token
    .results('pk_elem_dDe4r9M6X3Ad9zjpbgYpzLNtRCXfhPYR');
  ```

  ```python Python
  response = method
    .elements
    .token
    .results('pk_elem_dDe4r9M6X3Ad9zjpbgYpzLNtRCXfhPYR')
  ```
</RequestExample>

<ResponseExample>
  ```json
  {
    "authenticated": true,
    "cxn_id": "cxn_xr86xHEcWmpmB",
    "accounts": [
      "acc_jPXLFqd6KzH3N",
      "acc_DALLeLrj3TH8h"
    ],
    "entity_id": "ent_GWKYtnFyE79db",
    "events": [
      {
        "type": "open",
        "metadata": {
          "element_type": "connect",
          "op": "open"
        },
        "timestamp": "2024-04-25T02:35:28.097Z"
      },
      {
        "type": "success",
        "metadata": {
          "entity_id": "ent_GWKYtnFyE79db",
          "accounts": [
            "acc_jPXLFqd6KzH3N",
            "acc_DALLeLrj3TH8h"
          ],
          "element_type": "connect",
          "op": "success"
        },
        "timestamp": "2024-04-25T02:35:57.120Z"
      },
      {
        "type": "exit",
        "metadata": {
          "element_type": "connect",
          "op": "exit"
        },
        "timestamp": "2024-04-25T02:35:57.138Z"
      }
    ]
  }
  ```
</ResponseExample>

#### Auth Events

| Event prefix        | Description                                                                                                       |
| ------------------- | ----------------------------------------------------------------------------------------------------------------- |
| AUTH\_INTRO         | Indicates when the user opens, closes, or continues past the Intro screen                                         |
| AUTH\_NAME          | Indicates when the user opens, closes, or continues past the input name screen                                    |
| AUTH\_PHONE         | Indicates when the user opens, closes, or continues past the input phone screen                                   |
| AUTH\_PHONE\_VERIFY | Indicates when the user opens the phone verification screen, submits a code, resends a code, or closes the screen |
| AUTH\_DOB           | Indicates when the user opens, closes, or continues past the date of birth input screen                           |
| AUTH\_ADDRESS       | Indicates when the user opens, closes, or continues past the address input screen                                 |
| AUTH\_SSN4          | Indicates when the user opens, closes, or continues past the last 4 of SSN input screen                           |
| AUTH\_SECQ          | Indicates when the user opens, closes, incorrectly answers, or continues past the security questions screen       |
| AUTH\_CONSENT       | Indicates when the user opens, closes, or continues past the account consent screen                               |
| AUTH\_SUCCESS       | Indicates when the user successfully completes the Authentication portion of Connect                              |
| AUTH\_FAILURE       | Indicates if the user ran into an error during the Authentication portion of Connect                              |

#### Account Verification Events

| Event prefix         | Description                                                                                                                   |
| -------------------- | ----------------------------------------------------------------------------------------------------------------------------- |
| AVF\_ACCOUNT\_LIST   | Indicates when the user opens or exits out of the account list                                                                |
| AVF\_LEARN\_MORE     | Indicates when the user opens or exits out of the Learn More modal                                                            |
| AVF\_ACCOUNT\_VERIFY | Indicates when the user opens, submits, or closes the verification modal for a specific account                               |
| AVF\_SUCCESS         | Indicates when the user opens or continues past the verification success screen                                               |
| AVF\_EMPTY\_SUCCESS  | Indicates when the user opens or continues past the success screen shown if there were no accounts that required verification |
| AVF\_SKIP\_ALL       | Indicates when the user skips all account verifications                                                                       |
| AVF\_ERROR           | Indicates when the user is displyed an error screen during account verification                                               |


# Create Session

POST /elements/token
`POST /elements/token`

export const ParamList = ({items, is_child = false}) => {
  return items.map(item => {
    const field_props = {
      id: Math.random().toString(),
      body: item.name,
      name: item.name,
      type: item.type,
      required: item.required
    };
    const enums = item.enums || [];
    const items = item.items || [];
    const has_items = items?.length > 0;
    const has_enums = enums?.length > 0;
    const should_default_open = item.defaultOpen | false;
    const render_child_item = () => {
      const child_props = {
        title: has_enums ? "Possible enum values" : "properties"
      };
      if (should_default_open) child_props.defaultOpen = true;
      const has_inline_enums = has_enums && enums.every(enum_item => typeof enum_item === 'string') && enums.map((enum_item, idx) => {
        const is_last = idx === enums.length - 1;
        const is_2nd_to_last = idx === enums.length - 2;
        return <>
            <code>{enum_item}</code>
            {is_last && ''}
            {is_2nd_to_last && ' or '}
            {!is_last && !is_2nd_to_last && ', '}
          </>;
      });
      const enum_list = has_enums && !has_inline_enums && <Accordion {...child_props}>
          {enums.map(enum_item => <>
              <code>{enum_item.name}</code>
              <br />
              <p>{enum_item.description}</p>
            </>)}
        </Accordion>;
      const item_list = has_items && <Expandable {...child_props}>
          <ParamList items={items || []} is_child />
        </Expandable>;
      return <>
          <p>
            {item.description}
            {has_inline_enums && [has_inline_enums.length > 1 ? ' One of ' : ' Must be ', ...has_inline_enums]}
          </p>

          {enum_list}
          {item_list}
        </>;
    };
    return is_child ? <ResponseField {...field_props}>{render_child_item()}</ResponseField> : <ParamField {...field_props}>{render_child_item()}</ParamField>;
  });
};

Starting an Element Session is as simple as creating an Element Token with a supported Session `type`

## Body

<ParamList
  items={[
  {
    name: "type",
    type: "enum",
    description: "The type of session to start.",
    required: true,
    enums: ["balance_transfer"]
  },
  {
    name: "entity_id",
    type: "string",
    description: "The ID of the associated Entity.",
    required: true
  },
  {
    name: 'balance_transfer',
    type: 'object, null',
    required: false,
    description: 'The balance transfer object to be processed.',
  },
  ]}
/>

## Additional fields based on session type

<Tabs>
  <Tab title="balance_transfer">
    <ParamList
      items={[
        {
          name: "balance_transfer",
          type: "object, null",
          defaultOpen: true,
          description: "The balance transfer object to be processed.",
          items: [
            { name: "balance_transfer.flow_type", type: "string", description: "The type of flow to start."},
            { name: "balance_transfer.payout_amount_min", type: "number", description: "The minimum amount that has be paid out." },
            { name: "balance_transfer.minimum_loan_amount", type: "number", description: "The minimum amount that can be loaned." },
            { name: "balance_transfer.payout_residual_amount_max", type: "number", description: "The maximum amount that can be paid out." },
            { name: "balance_transfer.loan_details_requested_amount", type: "number", description: "The amount requested for the loan." },
            { name: "balance_transfer.loan_details_requested_term", type: "number", description: "The term requested for the loan." },
            { name: "balance_transfer.loan_details_requested_rate", type: "number", description: "The rate requested for the loan." },
            { name: "balance_transfer.loan_details_requested_monthly_payment", type: "number", description: "The monthly payment requested for the loan." },
          ]
        }
      ]}
    />
  </Tab>
</Tabs>

## Returns

Returns a Session object.

{/* add body of type, entity_id, and balance_transfer object */}

<RequestExample>
  ```bash cURL
  curl 'https://production.methodfi.com/token' \
    -X POST \
    -H 'Authorization: Bearer sk_WyZEWVfTcH7GqmPzUPk65Vjc' \
    -H "Content-Type: application/json" \
    -d '{
      "type": "balance_transfer",
      "entity_id": "ent_4t8ycqn435",
      "balance_transfer": {
        ...
      }
    }'
  ```
</RequestExample>

<ResponseExample>
  ```json
  {
    "success": true,
    "data": {
      "element_token": "pk_elem_qEqwrYEUELA6ExqfB4y8jjmpN8yBb38M",
      "element_session_id": "elem_sess_dYJpqRhKNzaqw"
      },
    "message": null
  }
  ```
</ResponseExample>


# Get Session

GET /elements/sessions/:session_id
`GET /elements/sessions/:session_id`

export const ParamList = ({items, is_child = false}) => {
  return items.map(item => {
    const field_props = {
      id: Math.random().toString(),
      body: item.name,
      name: item.name,
      type: item.type,
      required: item.required
    };
    const enums = item.enums || [];
    const items = item.items || [];
    const has_items = items?.length > 0;
    const has_enums = enums?.length > 0;
    const should_default_open = item.defaultOpen | false;
    const render_child_item = () => {
      const child_props = {
        title: has_enums ? "Possible enum values" : "properties"
      };
      if (should_default_open) child_props.defaultOpen = true;
      const has_inline_enums = has_enums && enums.every(enum_item => typeof enum_item === 'string') && enums.map((enum_item, idx) => {
        const is_last = idx === enums.length - 1;
        const is_2nd_to_last = idx === enums.length - 2;
        return <>
            <code>{enum_item}</code>
            {is_last && ''}
            {is_2nd_to_last && ' or '}
            {!is_last && !is_2nd_to_last && ', '}
          </>;
      });
      const enum_list = has_enums && !has_inline_enums && <Accordion {...child_props}>
          {enums.map(enum_item => <>
              <code>{enum_item.name}</code>
              <br />
              <p>{enum_item.description}</p>
            </>)}
        </Accordion>;
      const item_list = has_items && <Expandable {...child_props}>
          <ParamList items={items || []} is_child />
        </Expandable>;
      return <>
          <p>
            {item.description}
            {has_inline_enums && [has_inline_enums.length > 1 ? ' One of ' : ' Must be ', ...has_inline_enums]}
          </p>

          {enum_list}
          {item_list}
        </>;
    };
    return is_child ? <ResponseField {...field_props}>{render_child_item()}</ResponseField> : <ParamField {...field_props}>{render_child_item()}</ParamField>;
  });
};

## Path Parameters

<ParamList
  items={[
  {
  name: 'session_id',
  type: 'string',
  required: true,
  description: 'ID of the Session.',
  }
  ]}
/>

## Returns

Returns a Session object.

<RequestExample>
  ```bash cURL
  curl '{BASE_URL}/elements/sessions/:session_id' \
    -H 'Authorization: Bearer {API_KEY}'
  ```
</RequestExample>

<ResponseExample>
  ```json
  {
    "success": true,
    "data": {
      "id": "elem_sess_bTgeRWQ3qApfJ",
      "type": "balance_transfer",
      "status": "active",
      "balance_transfer": {
        "flow_type": "penfed_dpo",
        "remainder_opt_in": null,
        "auth_session_completed": false,
        "is_first_pass": true,
        "payout_status": "pending_accounts",
        "payout_ids": {},
        "payout_accounts": {},
        "payout_residual_amount": null,
        "payout_residual_amount_max": 56000,
        "payout_creditor_amount": null,
        "payout_amount_min": 50000,
        "minimum_loan_amount": 200000,
        "loan_details_requested_amount": 560000,
        "loan_details_requested_rate": 3.6,
        "loan_details_requested_term": 12,
        "loan_details_requested_monthly_payment": 17500,
        "loan_details_approved_amount": null,
        "loan_details_approved_rate": null,
        "loan_details_approved_term": null,
        "loan_details_approved_monthly_payment": null,
        "skip_intro": true,
      },
      "created_at": "2024-05-02T18:32:36.457Z",
      "updated_at": "2024-05-02T18:32:36.457Z"
    },
    "message": null
  }
  ```
</ResponseExample>


# The sessions endpoint



export const entity_verification_session_name = "EntityVerificationSession";

export const get_common_parameters = (resource_name = 'resource') => {
  return {
    id: {
      name: 'id',
      type: "string",
      required: false,
      description: `Unique identifier for the ${resource_name}.`
    },
    entity_id: {
      name: 'entity_id',
      type: 'string',
      required: false,
      description: 'The ID of the associated Entity.'
    },
    account_id: {
      name: 'account_id',
      type: 'string',
      required: false,
      description: 'The ID of the associated Account.'
    },
    error: {
      name: 'error',
      type: 'object | null',
      required: false,
      description: <>
          An object representing an error that occurred while processing
          this {resource_name}. See <a href={`/reference/errors/${resource_name.replace(/^([A-Z])/, function (match) {
        return match.toLowerCase();
      }).replace(/([A-Z])/g, function (match) {
        return "-" + match.toLowerCase();
      })}-errors`}>{resource_name} errors</a>.
        </>
    },
    status_error: {
      name: 'status_error',
      type: 'object | null',
      required: false,
      description: <>
          An object representing an error that occurred while processing
          this {resource_name}. See <a href="/reference/errors/product-errors#status-errors">{resource_name} errors</a>.
        </>
    },
    metadata: {
      name: 'metadata',
      type: 'object | null',
      required: false,
      description: <>
          Additional data provided during creation.
          See <a href="/reference/metadata">metadata</a>
        </>
    },
    created_at: {
      name: 'created_at',
      type: 'string',
      required: false,
      description: `Timestamp of when the ${resource_name} was created.`
    },
    updated_at: {
      name: 'updated_at',
      type: 'string',
      required: false,
      description: `Timestamp of when the ${resource_name} was last updated.`
    },
    status: (enums = []) => ({
      name: 'status',
      type: 'enum',
      required: false,
      description: `Status of the ${resource_name}.`,
      enums
    }),
    type: (enums = []) => ({
      name: 'type',
      type: 'enum',
      required: false,
      description: `The type of ${resource_name}.`,
      enums
    })
  };
};

export const ParamList = ({items, is_child = false}) => {
  return items.map(item => {
    const field_props = {
      id: Math.random().toString(),
      body: item.name,
      name: item.name,
      type: item.type,
      required: item.required
    };
    const enums = item.enums || [];
    const items = item.items || [];
    const has_items = items?.length > 0;
    const has_enums = enums?.length > 0;
    const should_default_open = item.defaultOpen | false;
    const render_child_item = () => {
      const child_props = {
        title: has_enums ? "Possible enum values" : "properties"
      };
      if (should_default_open) child_props.defaultOpen = true;
      const has_inline_enums = has_enums && enums.every(enum_item => typeof enum_item === 'string') && enums.map((enum_item, idx) => {
        const is_last = idx === enums.length - 1;
        const is_2nd_to_last = idx === enums.length - 2;
        return <>
            <code>{enum_item}</code>
            {is_last && ''}
            {is_2nd_to_last && ' or '}
            {!is_last && !is_2nd_to_last && ', '}
          </>;
      });
      const enum_list = has_enums && !has_inline_enums && <Accordion {...child_props}>
          {enums.map(enum_item => <>
              <code>{enum_item.name}</code>
              <br />
              <p>{enum_item.description}</p>
            </>)}
        </Accordion>;
      const item_list = has_items && <Expandable {...child_props}>
          <ParamList items={items || []} is_child />
        </Expandable>;
      return <>
          <p>
            {item.description}
            {has_inline_enums && [has_inline_enums.length > 1 ? ' One of ' : ' Must be ', ...has_inline_enums]}
          </p>

          {enum_list}
          {item_list}
        </>;
    };
    return is_child ? <ResponseField {...field_props}>{render_child_item()}</ResponseField> : <ParamField {...field_props}>{render_child_item()}</ParamField>;
  });
};

Sessions are a way for users to interact with Method Elements in a more stateful way.
You will be able to create, update, and retrieve session data each time a user travels through the Element.

<Info>
  Method Session is currently only available for [Method Balance Transfer](/reference/elements/balance-transfer).
</Info>

<Warning>
  Each Element Token will still expire 30 minutes after creation. If the
  element session is not completed within that time limit, another element token
  will need to be generated with the same session in order to resume.
</Warning>

## Session Objects

<ParamList
  items={[
  get_common_parameters('Session').id,
  get_common_parameters('Session').type(
    enums=["balance_transfer"]
  ),
  get_common_parameters('Session').status(
    enums=["active", "inactive"]
  ),
  {
    name: "balance_transfer",
    type: "object, null",
    description: "The balance transfer object to be processed.",
    items: [
      { name: "balance_transfer.flow_type", type: "string", description: "The type of flow to start."},
      { name: "balance_transfer.payout_amount_min", type: "number", description: "The minimum amount that can be paid out." },
      { name: "balance_transfer.minimum_loan_amount", type: "number", description: "The minimum amount that can be loaned." },
      { name: "balance_transfer.payout_residual_amount_max", type: "number", description: "The maximum amount that can be paid out." },
      { name: "balance_transfer.loan_details_requested_amount", type: "number", description: "The amount requested for the loan." },
      { name: "balance_transfer.loan_details_requested_term", type: "number", description: "The term requested for the loan." },
      { name: "balance_transfer.loan_details_requested_rate", type: "number", description: "The rate requested for the loan." },
      { name: "balance_transfer.loan_details_requested_monthly_payment", type: "number", description: "The monthly payment requested for the loan." },
    ]
  },
  get_common_parameters('Session').created_at,
  get_common_parameters('Session').updated_at
  ]}
/>

<RequestExample>
  ```json THE SESSIONS OBJECT
    {
      "id": "elem_sess_bTgeR3QzqApfJ",
      "type": "balance_transfer",
      "status": "active",
      "balance_transfer": {
        "flow_type": "default",
        "remainder_opt_in": null,
        "auth_session_completed": false,
        "is_first_pass": true,
        "payout_status": "pending_accounts",
        "payout_ids": {},
        "payout_accounts": {},
        "payout_residual_amount": null,
        "payout_residual_amount_max": 56000,
        "payout_creditor_amount": null,
        "payout_amount_min": 50000,
        "minimum_loan_amount": 200000,
        "loan_details_requested_amount": 560000,
        "loan_details_requested_rate": 3.6,
        "loan_details_requested_term": 12,
        "loan_details_requested_monthly_payment": 17500,
        "loan_details_approved_amount": null,
        "loan_details_approved_rate": null,
        "loan_details_approved_term": null,
        "loan_details_approved_monthly_payment": null,
        "skip_intro": true
      },
      "created_at": "2024-05-02T18:32:36.457Z",
      "updated_at": "2024-05-02T18:32:36.457Z"
    }
  ```
</RequestExample>


# Update Session

PUT /elements/sessions/:session_id
`PUT /elements/sessions/:session_id`

export const ParamList = ({items, is_child = false}) => {
  return items.map(item => {
    const field_props = {
      id: Math.random().toString(),
      body: item.name,
      name: item.name,
      type: item.type,
      required: item.required
    };
    const enums = item.enums || [];
    const items = item.items || [];
    const has_items = items?.length > 0;
    const has_enums = enums?.length > 0;
    const should_default_open = item.defaultOpen | false;
    const render_child_item = () => {
      const child_props = {
        title: has_enums ? "Possible enum values" : "properties"
      };
      if (should_default_open) child_props.defaultOpen = true;
      const has_inline_enums = has_enums && enums.every(enum_item => typeof enum_item === 'string') && enums.map((enum_item, idx) => {
        const is_last = idx === enums.length - 1;
        const is_2nd_to_last = idx === enums.length - 2;
        return <>
            <code>{enum_item}</code>
            {is_last && ''}
            {is_2nd_to_last && ' or '}
            {!is_last && !is_2nd_to_last && ', '}
          </>;
      });
      const enum_list = has_enums && !has_inline_enums && <Accordion {...child_props}>
          {enums.map(enum_item => <>
              <code>{enum_item.name}</code>
              <br />
              <p>{enum_item.description}</p>
            </>)}
        </Accordion>;
      const item_list = has_items && <Expandable {...child_props}>
          <ParamList items={items || []} is_child />
        </Expandable>;
      return <>
          <p>
            {item.description}
            {has_inline_enums && [has_inline_enums.length > 1 ? ' One of ' : ' Must be ', ...has_inline_enums]}
          </p>

          {enum_list}
          {item_list}
        </>;
    };
    return is_child ? <ResponseField {...field_props}>{render_child_item()}</ResponseField> : <ParamField {...field_props}>{render_child_item()}</ParamField>;
  });
};

Update a Session object by its ID.

## Body

<ParamList
  items={[
  {
  name: 'balance_transfer',
  type: 'object',
  description: 'The balance transfer object containing fields to update. See Guides for more information',
  },
  ]}
/>

## Additional fields based on session type

<Tabs>
  <Tab title="balance_transfer">
    <ParamList
      items={[
        {
          name: "balance_transfer",
          type: "object, null",
          defaultOpen: true,
          description: "The balance transfer object to be processed.",
          items: [
            { name: "balance_transfer.flow_type", type: "string", description: "The type of flow to start."},
            { name: "balance_transfer.payout_amount_min", type: "number", description: "The minimum amount that has be paid out." },
            { name: "balance_transfer.minimum_loan_amount", type: "number", description: "The minimum amount that can be loaned." },
            { name: "balance_transfer.payout_residual_amount_max", type: "number", description: "The maximum amount that can be paid out." },
            { name: "balance_transfer.loan_details_requested_amount", type: "number", description: "The amount requested for the loan." },
            { name: "balance_transfer.loan_details_requested_term", type: "number", description: "The term requested for the loan." },
            { name: "balance_transfer.loan_details_requested_rate", type: "number", description: "The rate requested for the loan." },
            { name: "balance_transfer.loan_details_requested_monthly_payment", type: "number", description: "The monthly payment requested for the loan." },
          ]
        }
      ]}
    />
  </Tab>
</Tabs>

## Returns

Returns a Session object.

<RequestExample>
  ```bash cURL
  curl --location '{BASE_URL}/elements/sessions/:session_id' \
    -H 'Authorization: Bearer {API_KEY}'
    -H 'Content-Type: application/json'
    -d '{
      "balance_transfer": {
        "loan_details_approved_amount": 1000,
        "loan_details_approved_term": 12,
        "loan_details_approved_rate": 0.1,
        "loan_details_approved_monthly_payment": 100
      }
    }'
  ```
</RequestExample>

<ResponseExample>
  ```json
  {
    "success": true,
    "data": {
      "id": "elem_sess_iEJz3DWaTpeJG",
      "type": "balance_transfer",
      "balance_transfer": {
        "flow_type": "penfed_dpo",
        "remainder_opt_in": null,
        "auth_session_completed": false,
        "is_first_pass": true,
        "payout_status": "pending_accounts",
        "payout_ids": {},
        "payout_accounts": {},
        "payout_residual_amount": null,
        "payout_residual_amount_max": 56000,
        "payout_creditor_amount": null,
        "payout_amount_min": 50000,
        "minimum_loan_amount": 200000,
        "loan_details_requested_amount": 560000,
        "loan_details_requested_rate": 3.6,
        "loan_details_requested_term": 12,
        "loan_details_requested_monthly_payment": 17500,
        "loan_details_approved_amount": null,
        "loan_details_approved_rate": null,
        "loan_details_approved_term": null,
        "loan_details_approved_monthly_payment": null,
        "skip_intro": true,
      },
      "created_at": "2024-04-15T20:50:51.251Z",
      "updated_at": "2024-04-15T20:51:59.426Z"
    },
    "message": null
  }
  ```
</ResponseExample>


# Create an Element Token

POST /elements/token

export const ParamList = ({items, is_child = false}) => {
  return items.map(item => {
    const field_props = {
      id: Math.random().toString(),
      body: item.name,
      name: item.name,
      type: item.type,
      required: item.required
    };
    const enums = item.enums || [];
    const items = item.items || [];
    const has_items = items?.length > 0;
    const has_enums = enums?.length > 0;
    const should_default_open = item.defaultOpen | false;
    const render_child_item = () => {
      const child_props = {
        title: has_enums ? "Possible enum values" : "properties"
      };
      if (should_default_open) child_props.defaultOpen = true;
      const has_inline_enums = has_enums && enums.every(enum_item => typeof enum_item === 'string') && enums.map((enum_item, idx) => {
        const is_last = idx === enums.length - 1;
        const is_2nd_to_last = idx === enums.length - 2;
        return <>
            <code>{enum_item}</code>
            {is_last && ''}
            {is_2nd_to_last && ' or '}
            {!is_last && !is_2nd_to_last && ', '}
          </>;
      });
      const enum_list = has_enums && !has_inline_enums && <Accordion {...child_props}>
          {enums.map(enum_item => <>
              <code>{enum_item.name}</code>
              <br />
              <p>{enum_item.description}</p>
            </>)}
        </Accordion>;
      const item_list = has_items && <Expandable {...child_props}>
          <ParamList items={items || []} is_child />
        </Expandable>;
      return <>
          <p>
            {item.description}
            {has_inline_enums && [has_inline_enums.length > 1 ? ' One of ' : ' Must be ', ...has_inline_enums]}
          </p>

          {enum_list}
          {item_list}
        </>;
    };
    return is_child ? <ResponseField {...field_props}>{render_child_item()}</ResponseField> : <ParamField {...field_props}>{render_child_item()}</ParamField>;
  });
};

Element tokens are used as the starting point and authentication key to instantiate Method's embeddable UI components within your experience.

<Note>
  For security purposes, element tokens are for one-time use only, and expire after 30 minutes.
</Note>

## Body

The structure of the request body differs slightly depending on the type of Element you are trying to use. See the [Elements Guide](/elements/overview) for more information about specific flows.

<Note>
  Either `entity_id` or `connect.entity` is required.
</Note>

<ParamList
  items={[
  {
  name: `type`,
  type: 'enum',
  required: true,
  description: 'The name of the element type you want to generate the token for.',
  enums: ['connect', 'balance_transfer'],
  },
  {
  name: 'entity_id',
  type: 'string',
  required: false,
  description: 'An existing entity id that the Element session will initiate for.'
  },
  {
  name: 'connect',
  type: 'object',
  required: false,
  description: 'Information needed if creating a Connect Element token.',
  items: [
    {
      name: 'products',
      type: 'enum',
      required: true,
      description: `The account products that you want to Connect this entity's accounts with. An empty list can be passed in as well.`,
      enums: ['balance', 'payoff', 'transactions', 'card', 'update'],
    },
    {
      name: 'accounts',
      type: 'array',
      required: false,
      description: (<>A list of accounts associated with the entity that you want to Connect (note <code>entity_id</code> must also be provided).</>),
    },
    {
      name: 'entity',
      type: 'object',
      required: false,
      description: (
        <>
          Information about the entity that the Element session will initiate for.
          See the <a href="/reference/entities/create-individual">Individual Entity</a> page for information about fields in the individual object.
        </>
      ),
      items: []
    },
    {
      name: 'account_filters',
      type: 'object',
      required: false,
      description: 'Optional filters to restrict which liability types are shown or to restrict how many accounts the user can select.',
      items: [
        {
          name: 'liability_types',
          type: 'enum',
          required: false,
          description: `A list of liability types that should be shown for the user.`,
          enums: ['auto_loan', 'mortgage', 'credit_card', 'loan', 'student_loan', 'personal_loan'],
        },
        {
          name: 'selection_type',
          type: 'enum',
          required: false,
          description: `Indicates whether the user should be able to only select one or multiple accounts.`,
          enums: ['single', 'multiple'],
        },
      ]
    }
  ]
  },
  {
  name: 'balance_transfer',
  type: 'object',
  required: false,
  description: 'Information needed if creating a Balance Transfer Element token.',
  items: [
    {
      name: 'payout_amount_min',
      type: 'number',
      required: true,
      description: 'The minimum amount that needs to be paid out per creditor.'
    },
    {
      name: 'minimum_loan_amount',
      type: 'number',
      required: true,
      description: 'The minimum loan amount that should be requested.'
    },
    {
      name: 'payout_residual_amount_max',
      type: 'number',
      required: true,
      description: 'The maximum residual amount that can be paid out, after payments to creditors.'
    },
    {
      name: 'loan_details_requested_amount',
      type: 'number',
      required: true,
      description: 'The amount of the loan that is requested.'
    },
    {
      name: 'loan_details_requested_rate',
      type: 'number',
      required: true,
      description: 'The interest rate of the loan that is requested.'
    },
    {
      name: 'loan_details_requested_term',
      type: 'number',
      required: true,
      description: 'The term of the loan that is requested.'
    },
    {
      name: 'loan_details_requested_monthly_payment',
      type: 'number',
      required: true,
      description: 'The monthly payment of the loan that is requested.'
    }
  ]
  },
  ]}
/>

## Returns

The element token that was created.

<RequestExample>
  ```bash cURL
  curl https://production.methodfi.com/elements/token \
    -X POST \
    -H "Method-Version: 2024-04-04" \
    -H "Authorization: Bearer sk_WyZEWVfTcH7GqmPzUPk65Vjc" \
    -H "Content-Type: application/json" \
    -d '{
      "type": "connect",
      "connect": {
        "products": ["balance"],
        "entity": {
          "type": "individual",
          "individual": {
            "first_name": "Kevin",
            "last_name": "Doyle"
          }
        }
      }
    }'
  ```

  ```javascript Node.js
  const token = await method.elements.token.create({
    type: "connect",
    connect: {
      products: ["balance"],
      entity: {
        type: "individual",
        individual: {
          first_name: "Kevin",
          last_name: "Doyle"
        }
      }
    }
  });
  ```

  ```python Python
  token = method.elements.token.create({
    'type': 'connect',
    'connect': {
      'products': ['balance'],
      'entity': {
        'type': 'individual',
        'individual': {
          'first_name': 'Kevin',
          'last_name': 'Doyle'
        }
      }
    }
  })
  ```
</RequestExample>

<ResponseExample>
  ```json
  {
    "element_token": "pk_elem_qPmypE9wwphr3WL3yTj7JhxjrPzAmK8G"
  }
  ```
</ResponseExample>


# Create Attributes

POST /entities/{ent_id}/attributes

export const ParamList = ({items, is_child = false}) => {
  return items.map(item => {
    const field_props = {
      id: Math.random().toString(),
      body: item.name,
      name: item.name,
      type: item.type,
      required: item.required
    };
    const enums = item.enums || [];
    const items = item.items || [];
    const has_items = items?.length > 0;
    const has_enums = enums?.length > 0;
    const should_default_open = item.defaultOpen | false;
    const render_child_item = () => {
      const child_props = {
        title: has_enums ? "Possible enum values" : "properties"
      };
      if (should_default_open) child_props.defaultOpen = true;
      const has_inline_enums = has_enums && enums.every(enum_item => typeof enum_item === 'string') && enums.map((enum_item, idx) => {
        const is_last = idx === enums.length - 1;
        const is_2nd_to_last = idx === enums.length - 2;
        return <>
            <code>{enum_item}</code>
            {is_last && ''}
            {is_2nd_to_last && ' or '}
            {!is_last && !is_2nd_to_last && ', '}
          </>;
      });
      const enum_list = has_enums && !has_inline_enums && <Accordion {...child_props}>
          {enums.map(enum_item => <>
              <code>{enum_item.name}</code>
              <br />
              <p>{enum_item.description}</p>
            </>)}
        </Accordion>;
      const item_list = has_items && <Expandable {...child_props}>
          <ParamList items={items || []} is_child />
        </Expandable>;
      return <>
          <p>
            {item.description}
            {has_inline_enums && [has_inline_enums.length > 1 ? ' One of ' : ' Must be ', ...has_inline_enums]}
          </p>

          {enum_list}
          {item_list}
        </>;
    };
    return is_child ? <ResponseField {...field_props}>{render_child_item()}</ResponseField> : <ParamField {...field_props}>{render_child_item()}</ParamField>;
  });
};

Creates a new Attribute request to retrieve the Entity's attributes.

Operation Type: <Tooltip tip="Your request is processed immediately, and you'll receive a response before proceeding.">⚡ Synchronous</Tooltip>

## Path Parameters

<ParamList
  items={[
  {
  name: 'ent_id',
  type: 'string',
  description: 'The ID of the Entity.'
  }
  ]}
/>

## Returns

Returns an Entity's Attributes object.

<RequestExample>
  ```bash cURL
  curl https://production.methodfi.com/entities/ent_au22b1fbFJbp8/attributes \
    -X POST \
    -H "Method-Version: 2024-04-04" \
    -H "Authorization: Bearer sk_WyZEWVfTcH7GqmPzUPk65Vjc"
  ```

  ```javascript Node.js
  const entity = await method
    .entities('ent_au22b1fbFJbp8')
    .attributes
    .create();
  ```

  ```python Python
  entity = method
  .entities('ent_au22b1fbFJbp8')
  .attributes
  .create()
  ```
</RequestExample>

<ResponseExample>
  ```json
  {
  "success": true,
  "data": {
    "id": "attr_nrPjaahMX4yRA",
    "entity_id": "ent_BzirqpLEm3BW7",
    "status": "completed",
    "attributes": {
      "credit_health_credit_card_usage": {
        "value": 22,
        "rating": "good"
      },
      "credit_health_derogatory_marks": {
        "value": 1,
        "rating": "fair"
      },
      "credit_health_hard_inquiries": {
        "value": 1,
        "rating": "fair"
      },
      "credit_health_total_accounts": {
        "value": 15,
        "rating": "fair"
      },
      "credit_health_credit_age": {
        "value": 42,
        "rating": "needs_work"
      },
      "credit_health_payment_history": {
        "value": 100,
        "rating": "excellent"
      }
    },
    "error": null,
    "created_at": "2024-09-09T00:16:44.838Z",
    "updated_at": "2024-09-09T00:16:44.838Z"
  },
  "message": null
  }
  ```
</ResponseExample>


# The attributes endpoint



export const credit_score_name = "CreditScore";

export const attribute_name = "Attribute";

export const get_common_parameters = (resource_name = 'resource') => {
  return {
    id: {
      name: 'id',
      type: "string",
      required: false,
      description: `Unique identifier for the ${resource_name}.`
    },
    entity_id: {
      name: 'entity_id',
      type: 'string',
      required: false,
      description: 'The ID of the associated Entity.'
    },
    account_id: {
      name: 'account_id',
      type: 'string',
      required: false,
      description: 'The ID of the associated Account.'
    },
    error: {
      name: 'error',
      type: 'object | null',
      required: false,
      description: <>
          An object representing an error that occurred while processing
          this {resource_name}. See <a href={`/reference/errors/${resource_name.replace(/^([A-Z])/, function (match) {
        return match.toLowerCase();
      }).replace(/([A-Z])/g, function (match) {
        return "-" + match.toLowerCase();
      })}-errors`}>{resource_name} errors</a>.
        </>
    },
    status_error: {
      name: 'status_error',
      type: 'object | null',
      required: false,
      description: <>
          An object representing an error that occurred while processing
          this {resource_name}. See <a href="/reference/errors/product-errors#status-errors">{resource_name} errors</a>.
        </>
    },
    metadata: {
      name: 'metadata',
      type: 'object | null',
      required: false,
      description: <>
          Additional data provided during creation.
          See <a href="/reference/metadata">metadata</a>
        </>
    },
    created_at: {
      name: 'created_at',
      type: 'string',
      required: false,
      description: `Timestamp of when the ${resource_name} was created.`
    },
    updated_at: {
      name: 'updated_at',
      type: 'string',
      required: false,
      description: `Timestamp of when the ${resource_name} was last updated.`
    },
    status: (enums = []) => ({
      name: 'status',
      type: 'enum',
      required: false,
      description: `Status of the ${resource_name}.`,
      enums
    }),
    type: (enums = []) => ({
      name: 'type',
      type: 'enum',
      required: false,
      description: `The type of ${resource_name}.`,
      enums
    })
  };
};

export const ParamList = ({items, is_child = false}) => {
  return items.map(item => {
    const field_props = {
      id: Math.random().toString(),
      body: item.name,
      name: item.name,
      type: item.type,
      required: item.required
    };
    const enums = item.enums || [];
    const items = item.items || [];
    const has_items = items?.length > 0;
    const has_enums = enums?.length > 0;
    const should_default_open = item.defaultOpen | false;
    const render_child_item = () => {
      const child_props = {
        title: has_enums ? "Possible enum values" : "properties"
      };
      if (should_default_open) child_props.defaultOpen = true;
      const has_inline_enums = has_enums && enums.every(enum_item => typeof enum_item === 'string') && enums.map((enum_item, idx) => {
        const is_last = idx === enums.length - 1;
        const is_2nd_to_last = idx === enums.length - 2;
        return <>
            <code>{enum_item}</code>
            {is_last && ''}
            {is_2nd_to_last && ' or '}
            {!is_last && !is_2nd_to_last && ', '}
          </>;
      });
      const enum_list = has_enums && !has_inline_enums && <Accordion {...child_props}>
          {enums.map(enum_item => <>
              <code>{enum_item.name}</code>
              <br />
              <p>{enum_item.description}</p>
            </>)}
        </Accordion>;
      const item_list = has_items && <Expandable {...child_props}>
          <ParamList items={items || []} is_child />
        </Expandable>;
      return <>
          <p>
            {item.description}
            {has_inline_enums && [has_inline_enums.length > 1 ? ' One of ' : ' Must be ', ...has_inline_enums]}
          </p>

          {enum_list}
          {item_list}
        </>;
    };
    return is_child ? <ResponseField {...field_props}>{render_child_item()}</ResponseField> : <ParamField {...field_props}>{render_child_item()}</ParamField>;
  });
};

The Attributes endpoint provides various credit health attributes for an Entity.

**The Attributes endpoint is available as a:**

| Type      | Use-Case                                         |
| --------- | ------------------------------------------------ |
| `Product` | On-Demand view of an Entity's credit attributes. |

## Attribute Objects

<ParamList
  items={[
  (get_common_parameters(attribute_name).id),
  (get_common_parameters().entity_id),
  (get_common_parameters(attribute_name).status(
  enums = [
    {
      name: 'pending',
      description: `The ${attribute_name} is queued to be retrieved.`
    },
    {
      name: 'in_progress',
      description: `The ${attribute_name} is being retrieved.`
    },
    {
      name: 'completed',
      description: `The ${attribute_name} has successfully been retrieved.`
    },
    {
      name: 'failed',
      description: `The ${attribute_name} failed to be retrieved.`
    }
  ]
  )),
  {
  name: 'attributes',
  type:'object',
  required: false,
  description: 'An object containing various credit health attributes.',
  items: [
    {
      name: 'attributes.credit_health_credit_card_usage',
      type: 'object',
      description: 'Credit usage percentage.',
      items: [
        {
          name: 'attributes.credit_health_credit_card_usage.value',
          type: 'number',
          description: 'The value of the credit card usage.'
        },
        {
          name: 'attributes.credit_health_credit_card_usage.rating',
          type: 'enum',
          description: 'The rating of the credit card usage.',
          enums: [
            {
              name: 'excellent',
              description: 'The credit card usage is excellent.'
            },
            {
              name: 'good',
              description: 'The credit card usage is good.'
            },
            {
              name: 'fair',
              description: 'The credit card usage is fair.'
            },
            {
              name: 'needs_work',
              description: 'The credit card usage needs work.'
            }
          ]
        }
      ]
    },
    {
      name: 'attributes.credit_health_derogatory_marks',
      type: 'object',
      description: 'Count of derogatory marks like collection records and public records.',
      items: [
        {
          name: 'attributes.credit_health_derogatory_marks.value',
          type: 'number',
          description: 'The value of the derogatory marks.'
        },
        {
          name: 'attributes.credit_health_derogatory_marks.rating',
          type: 'enum',
          description: 'The rating of the derogatory marks.',
          enums: [
            {
              name: 'excellent',
              description: 'The derogatory marks are excellent.'
            },
            {
              name: 'good',
              description: 'The derogatory marks are good.'
            },
            {
              name: 'fair',
              description: 'The derogatory marks are fair.'
            },
            {
              name: 'needs_work',
              description: 'The derogatory marks need work.'
            }
          ]
        }
      ]
    },
    {
      name: 'attributes.credit_health_hard_inquiries',
      type: 'object',
      description: 'Count of hard inquiries.',
      items: [
        {
          name: 'attributes.credit_health_hard_inquiries.value',
          type: 'number',
          description: 'The count of hard inquiries.'
        },
        {
          name: 'attributes.credit_health_hard_inquiries.rating',
          type: 'enum',
          description: 'The rating of the hard inquiries.',
          enums: [
            {
              name: 'excellent',
              description: 'The hard inquiries are excellent.'
            },
            {
              name: 'good',
              description: 'The hard inquiries are good.'
            },
            {
              name: 'fair',
              description: 'The hard inquiries are fair.'
            },
            {
              name: 'needs_work',
              description: 'The hard inquiries need work.'
            }
          ]
        }
      ]
    },
    {
      name: 'attributes.credit_health_total_accounts',
      type: 'object',
      description: 'Total number of open accounts.',
      items: [
        {
          name: 'attributes.credit_health_total_accounts.value',
          type: 'number',
          description: 'The count of total accounts.'
        },
        {
          name: 'attributes.credit_health_total_accounts.rating',
          type: 'enum',
          description: 'The rating of the total accounts.',
          enums: [
            {
              name: 'excellent',
              description: 'The total accounts are excellent.'
            },
            {
              name: 'good',
              description: 'The total accounts are good.'
            },
            {
              name: 'fair',
              description: 'The total accounts are fair.'
            },
            {
              name: 'needs_work',
              description: 'The total accounts need work.'
            }
          ]
        }
      ]
    },
    {
      name: 'attributes.credit_health_credit_age',
      type: 'object',
      description: 'The average age of all open accounts.',
      items: [
        {
          name: 'attributes.credit_health_credit_age.value',
          type: 'number',
          description: 'The average age of credit accounts in months.'
        },
        {
          name: 'attributes.credit_health_credit_age.rating',
          type: 'enum',
          description: 'The rating of the credit age.',
          enums: [
            {
              name: 'excellent',
              description: 'The credit age is excellent.'
            },
            {
              name: 'good',
              description: 'The credit age is good.'
            },
            {
              name: 'fair',
              description: 'The credit age is fair.'
            },
            {
              name: 'needs_work',
              description: 'The credit age needs work.'
            }
          ]
        }
      ]
    },
    {
      name: 'attributes.credit_health_payment_history',
      type: 'object',
      description: 'The percentage of on-time payments.',
      items: [
        {
          name: 'attributes.credit_health_payment_history.value',
          type: 'number',
          description: 'The percentage of on-time payments.'
        },
        {
          name: 'attributes.credit_health_payment_history.rating',
          type: 'enum',
          description: 'The rating of the payment history.',
          enums: [
            {
              name: 'excellent',
              description: 'The payment history is excellent.'
            },
            {
              name: 'good',
              description: 'The payment history is good.'
            },
            {
              name: 'fair',
              description: 'The payment history is fair.'
            },
            {
              name: 'needs_work',
              description: 'The payment history needs work.'
            }
          ]
        }
      ]
    }
  ]
  },
  (get_common_parameters(attribute_name).error),
  (get_common_parameters(attribute_name).created_at),
  (get_common_parameters(attribute_name).updated_at),
  ]}
/>

<RequestExample>
  ```json THE ATTRIBUTE OBJECT
  {
    "id": "attr_nrPjaahMX4yRA",
    "entity_id": "ent_AdMkLRpcgTGBQ",
    "status": "completed",
    "attributes": {
        "credit_health_credit_card_usage": {
            "value": 22,
            "rating": "good"
        },
        "credit_health_derogatory_marks": {
            "value": 1,
            "rating": "fair"
        },
        "credit_health_hard_inquiries": {
            "value": 1,
            "rating": "fair"
        },
        "credit_health_total_accounts": {
            "value": 15,
            "rating": "fair"
        },
        "credit_health_credit_age": {
            "value": 42,
            "rating": "needs_work"
        },
        "credit_health_payment_history": {
            "value": 100,
            "rating": "excellent"
        }
    },
    "error": null,
    "created_at": "2024-09-09T00:16:44.838Z",
    "updated_at": "2024-09-09T00:16:44.838Z"
  }
  ```
</RequestExample>


# Retrieve Attributes

GET /entities/{ent_id}/attributes/{attr_id}

export const ParamList = ({items, is_child = false}) => {
  return items.map(item => {
    const field_props = {
      id: Math.random().toString(),
      body: item.name,
      name: item.name,
      type: item.type,
      required: item.required
    };
    const enums = item.enums || [];
    const items = item.items || [];
    const has_items = items?.length > 0;
    const has_enums = enums?.length > 0;
    const should_default_open = item.defaultOpen | false;
    const render_child_item = () => {
      const child_props = {
        title: has_enums ? "Possible enum values" : "properties"
      };
      if (should_default_open) child_props.defaultOpen = true;
      const has_inline_enums = has_enums && enums.every(enum_item => typeof enum_item === 'string') && enums.map((enum_item, idx) => {
        const is_last = idx === enums.length - 1;
        const is_2nd_to_last = idx === enums.length - 2;
        return <>
            <code>{enum_item}</code>
            {is_last && ''}
            {is_2nd_to_last && ' or '}
            {!is_last && !is_2nd_to_last && ', '}
          </>;
      });
      const enum_list = has_enums && !has_inline_enums && <Accordion {...child_props}>
          {enums.map(enum_item => <>
              <code>{enum_item.name}</code>
              <br />
              <p>{enum_item.description}</p>
            </>)}
        </Accordion>;
      const item_list = has_items && <Expandable {...child_props}>
          <ParamList items={items || []} is_child />
        </Expandable>;
      return <>
          <p>
            {item.description}
            {has_inline_enums && [has_inline_enums.length > 1 ? ' One of ' : ' Must be ', ...has_inline_enums]}
          </p>

          {enum_list}
          {item_list}
        </>;
    };
    return is_child ? <ResponseField {...field_props}>{render_child_item()}</ResponseField> : <ParamField {...field_props}>{render_child_item()}</ParamField>;
  });
};

Retrieves an Attributes record for an Entity.

## Path Parameters

<ParamList
  items={[
  {
  name: 'ent_id',
  type: 'string',
  description: 'The ID of the entity.'
  },
  {
  name: 'attr_id',
  type: 'string',
  description: 'The ID of the Attribute.'
  }
  ]}
/>

## Returns

Returns an Entity's Attributes object.

<RequestExample>
  ```bash cURL
  curl https://production.methodfi.com/entities/ent_au22b1fbFJbp8/attributes/attr_nrPjaahMX4yRA \
    -H "Method-Version: 2024-04-04" \
    -H "Authorization: Bearer sk_WyZEWVfTcH7GqmPzUPk65Vjc"
  ```

  ```javascript Node.js
  const entity = await method
    .entities('ent_au22b1fbFJbp8')
    .attributes
    .retrieve('attr_nrPjaahMX4yRA');
  ```

  ```python Python
  entity = method
    .entities('ent_au22b1fbFJbp8')
    .attributes
    .retrieve('attr_nrPjaahMX4yRA')
  ```
</RequestExample>

<ResponseExample>
  ```json
  {
    "success": true,
    "data": {
      "id": "attr_nrPjaahMX4yRA",
      "entity_id": "ent_BzirqpLEm3BW7",
      "status": "completed",
      "attributes": {
        "credit_health_credit_card_usage": {
          "value": 22,
          "rating": "good"
        },
        "credit_health_derogatory_marks": {
          "value": 1,
          "rating": "fair"
        },
        "credit_health_hard_inquiries": {
          "value": 1,
          "rating": "fair"
        },
        "credit_health_total_accounts": {
          "value": 15,
          "rating": "fair"
        },
        "credit_health_credit_age": {
          "value": 42,
          "rating": "needs_work"
        },
        "credit_health_payment_history": {
          "value": 100,
          "rating": "excellent"
        }
      },
      "error": null,
      "created_at": "2024-09-09T00:16:44.838Z",
      "updated_at": "2024-09-09T00:16:44.838Z"
    },
    "message": null
  }
  ```
</ResponseExample>


# Create a Connect

POST /entities/{ent_id}/connect

export const connect_name = "Connect";

export const ParamList = ({items, is_child = false}) => {
  return items.map(item => {
    const field_props = {
      id: Math.random().toString(),
      body: item.name,
      name: item.name,
      type: item.type,
      required: item.required
    };
    const enums = item.enums || [];
    const items = item.items || [];
    const has_items = items?.length > 0;
    const has_enums = enums?.length > 0;
    const should_default_open = item.defaultOpen | false;
    const render_child_item = () => {
      const child_props = {
        title: has_enums ? "Possible enum values" : "properties"
      };
      if (should_default_open) child_props.defaultOpen = true;
      const has_inline_enums = has_enums && enums.every(enum_item => typeof enum_item === 'string') && enums.map((enum_item, idx) => {
        const is_last = idx === enums.length - 1;
        const is_2nd_to_last = idx === enums.length - 2;
        return <>
            <code>{enum_item}</code>
            {is_last && ''}
            {is_2nd_to_last && ' or '}
            {!is_last && !is_2nd_to_last && ', '}
          </>;
      });
      const enum_list = has_enums && !has_inline_enums && <Accordion {...child_props}>
          {enums.map(enum_item => <>
              <code>{enum_item.name}</code>
              <br />
              <p>{enum_item.description}</p>
            </>)}
        </Accordion>;
      const item_list = has_items && <Expandable {...child_props}>
          <ParamList items={items || []} is_child />
        </Expandable>;
      return <>
          <p>
            {item.description}
            {has_inline_enums && [has_inline_enums.length > 1 ? ' One of ' : ' Must be ', ...has_inline_enums]}
          </p>

          {enum_list}
          {item_list}
        </>;
    };
    return is_child ? <ResponseField {...field_props}>{render_child_item()}</ResponseField> : <ParamField {...field_props}>{render_child_item()}</ParamField>;
  });
};

Creates a new Connect request to connect all liability accounts for the Entity.

Operation Type: <Tooltip tip="Your request is processed immediately, and you'll receive a response before proceeding. Webhooks will be fired in parallel.">⚡ Synchronous</Tooltip>

<Tip>An initial Connect request will connect all liability accounts (closed and active),
all subsequent Connect requests will only return new accounts for an Entity.</Tip>

## Path Parameters

<ParamList
  items={[
  {
    name: "ent_id",
    type: "string",
    description: `The ID of the Entity.`,
  },
  ]}
/>

## Returns

Returns a {connect_name} object.

<RequestExample>
  ```bash cURL
  curl https://production.methodfi.com/entities/ent_qKNBB68bfHGNA/connect \
    -X POST \
    -H "Authorization: Bearer sk_WyZEWVfTcH7GqmPzUPk65Vjc"
  ```

  ```javascript Node.js
  const entity = await method
    .entities("ent_qKNBB68bfHGNA")
    .connect
    .create();
  ```

  ```python Python
  entity = method
    .entities('ent_qKNBB68bfHGNA')
    .connect
    .create()
  ```
</RequestExample>

<ResponseExample>
  ```json
  {
    "id": "cxn_4ewMmBbjYDMR4",
    "entity_id": "ent_qKNBB68bfHGNA",
    "status": "completed",
    "accounts": [
      "acc_eKKmrXDpJBKgw",
      "acc_GV8WbmJW7KGRy",
      "acc_MLPKh9gQDDbT8",
      "acc_LbXE8wVYJLrKt",
      "acc_J3P9fayDFjpAy",
      "acc_eFFRV9zmpLREK"
    ],
    "error": null,
    "created_at": "2024-04-12T14:56:46.645Z",
    "updated_at": "2024-04-12T14:56:46.645Z"
  }
  ```
</ResponseExample>


# The connect endpoint



export const connect_name = "Connect";

export const get_common_parameters = (resource_name = 'resource') => {
  return {
    id: {
      name: 'id',
      type: "string",
      required: false,
      description: `Unique identifier for the ${resource_name}.`
    },
    entity_id: {
      name: 'entity_id',
      type: 'string',
      required: false,
      description: 'The ID of the associated Entity.'
    },
    account_id: {
      name: 'account_id',
      type: 'string',
      required: false,
      description: 'The ID of the associated Account.'
    },
    error: {
      name: 'error',
      type: 'object | null',
      required: false,
      description: <>
          An object representing an error that occurred while processing
          this {resource_name}. See <a href={`/reference/errors/${resource_name.replace(/^([A-Z])/, function (match) {
        return match.toLowerCase();
      }).replace(/([A-Z])/g, function (match) {
        return "-" + match.toLowerCase();
      })}-errors`}>{resource_name} errors</a>.
        </>
    },
    status_error: {
      name: 'status_error',
      type: 'object | null',
      required: false,
      description: <>
          An object representing an error that occurred while processing
          this {resource_name}. See <a href="/reference/errors/product-errors#status-errors">{resource_name} errors</a>.
        </>
    },
    metadata: {
      name: 'metadata',
      type: 'object | null',
      required: false,
      description: <>
          Additional data provided during creation.
          See <a href="/reference/metadata">metadata</a>
        </>
    },
    created_at: {
      name: 'created_at',
      type: 'string',
      required: false,
      description: `Timestamp of when the ${resource_name} was created.`
    },
    updated_at: {
      name: 'updated_at',
      type: 'string',
      required: false,
      description: `Timestamp of when the ${resource_name} was last updated.`
    },
    status: (enums = []) => ({
      name: 'status',
      type: 'enum',
      required: false,
      description: `Status of the ${resource_name}.`,
      enums
    }),
    type: (enums = []) => ({
      name: 'type',
      type: 'enum',
      required: false,
      description: `The type of ${resource_name}.`,
      enums
    })
  };
};

export const ParamList = ({items, is_child = false}) => {
  return items.map(item => {
    const field_props = {
      id: Math.random().toString(),
      body: item.name,
      name: item.name,
      type: item.type,
      required: item.required
    };
    const enums = item.enums || [];
    const items = item.items || [];
    const has_items = items?.length > 0;
    const has_enums = enums?.length > 0;
    const should_default_open = item.defaultOpen | false;
    const render_child_item = () => {
      const child_props = {
        title: has_enums ? "Possible enum values" : "properties"
      };
      if (should_default_open) child_props.defaultOpen = true;
      const has_inline_enums = has_enums && enums.every(enum_item => typeof enum_item === 'string') && enums.map((enum_item, idx) => {
        const is_last = idx === enums.length - 1;
        const is_2nd_to_last = idx === enums.length - 2;
        return <>
            <code>{enum_item}</code>
            {is_last && ''}
            {is_2nd_to_last && ' or '}
            {!is_last && !is_2nd_to_last && ', '}
          </>;
      });
      const enum_list = has_enums && !has_inline_enums && <Accordion {...child_props}>
          {enums.map(enum_item => <>
              <code>{enum_item.name}</code>
              <br />
              <p>{enum_item.description}</p>
            </>)}
        </Accordion>;
      const item_list = has_items && <Expandable {...child_props}>
          <ParamList items={items || []} is_child />
        </Expandable>;
      return <>
          <p>
            {item.description}
            {has_inline_enums && [has_inline_enums.length > 1 ? ' One of ' : ' Must be ', ...has_inline_enums]}
          </p>

          {enum_list}
          {item_list}
        </>;
    };
    return is_child ? <ResponseField {...field_props}>{render_child_item()}</ResponseField> : <ParamField {...field_props}>{render_child_item()}</ParamField>;
  });
};

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 15,000+ FI / Lenders.

<Check>To further provide a comprehensive view the Connect endpoint
will perform a soft-pull of the Entity's credit report.</Check>

**The Connect endpoint is available as a:**

| Type           | Use-Case                                                                                                                                                |
| -------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Product`      | On-Demand comprehensive view of an Entity's outstanding liabilities.                                                                                    |
| `Subscription` | Comprehensive view of an Entity's outstanding liabilities and continuous near real-time updates on new liabilities. [Webhook Payload](#webhook-payload) |

## Connect Objects

<ParamList
  items={[
  get_common_parameters(connect_name).id,
  get_common_parameters().entity_id,
  get_common_parameters(connect_name).status(
    (enums = [
      {
        name: "pending",
        description: `The ${connect_name} request is queued to be processed.`,
      },
      {
        name: "in_progress",
        description: `The ${connect_name} request is being processed.`,
      },
      {
        name: "completed",
        description: `The ${connect_name} request has successfully processed.`,
      },
      {
        name: "failed",
        description: `The ${connect_name} request failed processing.`,
      },
    ])
  ),
  {
    name: "accounts",
    type: "string[] | null",
    description:
      "An array of new accounts that have been connected to this Entity.",
  },
  get_common_parameters(connect_name).error,
  get_common_parameters(connect_name).created_at,
  get_common_parameters(connect_name).updated_at,
  ]}
/>

## Webhook Payload

The [Webhook](/reference/webhooks/overview) payload will contain the following information:

```json
{
  "id": "string",
  "type": "connect.create" | "connect.update",
  "path": "/entities/<ent_id>/connect/<cxn_id>"
}
```

<RequestExample>
  ```json THE CONNECT OBJECT
  {
    "id": "cxn_4ewMmBbjYDMR4",
    "entity_id": "ent_qKNBB68bfHGNA",
    "status": "completed",
    "accounts": [
      "acc_eKKmrXDpJBKgw",
      "acc_GV8WbmJW7KGRy",
      "acc_MLPKh9gQDDbT8",
      "acc_LbXE8wVYJLrKt",
      "acc_J3P9fayDFjpAy",
      "acc_eFFRV9zmpLREK"
    ],
    "error": null,
    "created_at": "2024-04-12T14:56:46.645Z",
    "updated_at": "2024-04-12T14:56:46.645Z"
  }
  ```
</RequestExample>


# Retrieve a Connect

GET /entities/{ent_id}/connect/{cxn_id}

export const connect_name = "Connect";

export const ParamList = ({items, is_child = false}) => {
  return items.map(item => {
    const field_props = {
      id: Math.random().toString(),
      body: item.name,
      name: item.name,
      type: item.type,
      required: item.required
    };
    const enums = item.enums || [];
    const items = item.items || [];
    const has_items = items?.length > 0;
    const has_enums = enums?.length > 0;
    const should_default_open = item.defaultOpen | false;
    const render_child_item = () => {
      const child_props = {
        title: has_enums ? "Possible enum values" : "properties"
      };
      if (should_default_open) child_props.defaultOpen = true;
      const has_inline_enums = has_enums && enums.every(enum_item => typeof enum_item === 'string') && enums.map((enum_item, idx) => {
        const is_last = idx === enums.length - 1;
        const is_2nd_to_last = idx === enums.length - 2;
        return <>
            <code>{enum_item}</code>
            {is_last && ''}
            {is_2nd_to_last && ' or '}
            {!is_last && !is_2nd_to_last && ', '}
          </>;
      });
      const enum_list = has_enums && !has_inline_enums && <Accordion {...child_props}>
          {enums.map(enum_item => <>
              <code>{enum_item.name}</code>
              <br />
              <p>{enum_item.description}</p>
            </>)}
        </Accordion>;
      const item_list = has_items && <Expandable {...child_props}>
          <ParamList items={items || []} is_child />
        </Expandable>;
      return <>
          <p>
            {item.description}
            {has_inline_enums && [has_inline_enums.length > 1 ? ' One of ' : ' Must be ', ...has_inline_enums]}
          </p>

          {enum_list}
          {item_list}
        </>;
    };
    return is_child ? <ResponseField {...field_props}>{render_child_item()}</ResponseField> : <ParamField {...field_props}>{render_child_item()}</ParamField>;
  });
};

Retrieves a {connect_name} record for an Entity.

## Path Parameters

<ParamList
  items={[
  {
    name: "ent_id",
    type: "string",
    description: `The ID of the Entity.`,
  },
  {
    name: "cxn_id",
    type: "string",
    description: `The ID of the ${connect_name}.`,
  },
  ]}
/>

## Returns

Returns a {connect_name} object.

<RequestExample>
  ```bash cURL
  curl https://production.methodfi.com/entities/ent_qKNBB68bfHGNA/connect/cxn_4ewMmBbjYDMR4 \
    -H "Authorization: Bearer sk_WyZEWVfTcH7GqmPzUPk65Vjc"
  ```

  ```javascript Node.js
  const entity = await method
    .entities("ent_qKNBB68bfHGNA")
    .connect
    .retrieve("cxn_4ewMmBbjYDMR4");
  ```

  ```python Python
  entity = method
    .entities('ent_qKNBB68bfHGNA')
    .connect
    .retrieve('cxn_4ewMmBbjYDMR4')
  ```
</RequestExample>

<ResponseExample>
  ```json
  {
    "id": "cxn_4ewMmBbjYDMR4",
    "entity_id": "ent_qKNBB68bfHGNA",
    "status": "completed",
    "accounts": [
      "acc_eKKmrXDpJBKgw",
      "acc_GV8WbmJW7KGRy",
      "acc_MLPKh9gQDDbT8",
      "acc_LbXE8wVYJLrKt",
      "acc_J3P9fayDFjpAy",
      "acc_eFFRV9zmpLREK"
    ],
    "error": null,
    "created_at": "2024-04-12T14:56:46.645Z",
    "updated_at": "2024-04-12T14:56:46.645Z"
  }
  ```
</ResponseExample>


# Withdraw an Entity's Consent

POST /entities/{ent_id}/consent

export const ParamList = ({items, is_child = false}) => {
  return items.map(item => {
    const field_props = {
      id: Math.random().toString(),
      body: item.name,
      name: item.name,
      type: item.type,
      required: item.required
    };
    const enums = item.enums || [];
    const items = item.items || [];
    const has_items = items?.length > 0;
    const has_enums = enums?.length > 0;
    const should_default_open = item.defaultOpen | false;
    const render_child_item = () => {
      const child_props = {
        title: has_enums ? "Possible enum values" : "properties"
      };
      if (should_default_open) child_props.defaultOpen = true;
      const has_inline_enums = has_enums && enums.every(enum_item => typeof enum_item === 'string') && enums.map((enum_item, idx) => {
        const is_last = idx === enums.length - 1;
        const is_2nd_to_last = idx === enums.length - 2;
        return <>
            <code>{enum_item}</code>
            {is_last && ''}
            {is_2nd_to_last && ' or '}
            {!is_last && !is_2nd_to_last && ', '}
          </>;
      });
      const enum_list = has_enums && !has_inline_enums && <Accordion {...child_props}>
          {enums.map(enum_item => <>
              <code>{enum_item.name}</code>
              <br />
              <p>{enum_item.description}</p>
            </>)}
        </Accordion>;
      const item_list = has_items && <Expandable {...child_props}>
          <ParamList items={items || []} is_child />
        </Expandable>;
      return <>
          <p>
            {item.description}
            {has_inline_enums && [has_inline_enums.length > 1 ? ' One of ' : ' Must be ', ...has_inline_enums]}
          </p>

          {enum_list}
          {item_list}
        </>;
    };
    return is_child ? <ResponseField {...field_props}>{render_child_item()}</ResponseField> : <ParamField {...field_props}>{render_child_item()}</ParamField>;
  });
};

Withdraws an Entity's consent. This endpoint sets the entity's status to `disabled`, withdraws consent on all the entity's accounts,
and removes all active Products or Subscriptions across all the Entity's accounts.

## Path Parameters

<ParamList
  items={[
  {
  name: 'ent_id',
  type: 'string',
  required: true,
  description: 'ID of the Entity.',
  },
  ]}
/>

## Body

<ParamList
  items={[
  {
  name: 'type',
  type: 'enum',
  required: true,
  description: (
    <>
      Available types: <code>withdraw</code>.
    </>
  ),
  },
  {
  name: 'reason',
  type: 'string',
  required: true,
  description: (
    <>
      Available Reasons: <code>entity_withdrew_consent</code>.
    </>
  ),
  }
  ]}
/>

## Returns

Returns the entity with `status` set to `disabled`.

<RequestExample>
  ```bash cURL
  curl https://production.methodfi.com/entities/ent_au22b1fbFJbp8/consent \
    -X POST \
    -H "Authorization: Bearer sk_WyZEWVfTcH7GqmPzUPk65Vjc" \
    -H "Content-Type: application/json" \
    -d '{
      "type": "withdraw",
      "reason": "entity_withdrew_consent"
    }'
  ```

  ```javascript Node.js
  const entity = await method.entities.withdrawConsent('ent_au22b1fbFJbp8');
  ```

  ```python Python
  entity = method.entities.withdraw_consent('ent_au22b1fbFJbp8', {
    'type': 'withdraw',
    'reason': 'entity_withdrew_consent'
  })
  ```
</RequestExample>

<ResponseExample>
  ```json
   {
    "id": "ent_qJk8AJ9grkGHg",
    "type": null,
    "individual": null,
    "corporation": null,
    "receive_only": null,
    "verification": null,
    "error": {
      "type": "ENTITY_DISABLED",
      "sub_type": "ENTITY_CONSENT_WITHDRAWN",
      "code": 12004,
      "message": "Entity was disabled due to consent withdrawal."
    },
    "address": {},
    "status": "disabled",
    "metadata": null,
    "created_at": "2024-05-31T21:27:46.044Z",
    "updated_at": "2024-05-31T21:27:49.468Z"
  }

  ```
</ResponseExample>


# Create a Corporation

POST https://production.methodfi.com/entities

export const ParamList = ({items, is_child = false}) => {
  return items.map(item => {
    const field_props = {
      id: Math.random().toString(),
      body: item.name,
      name: item.name,
      type: item.type,
      required: item.required
    };
    const enums = item.enums || [];
    const items = item.items || [];
    const has_items = items?.length > 0;
    const has_enums = enums?.length > 0;
    const should_default_open = item.defaultOpen | false;
    const render_child_item = () => {
      const child_props = {
        title: has_enums ? "Possible enum values" : "properties"
      };
      if (should_default_open) child_props.defaultOpen = true;
      const has_inline_enums = has_enums && enums.every(enum_item => typeof enum_item === 'string') && enums.map((enum_item, idx) => {
        const is_last = idx === enums.length - 1;
        const is_2nd_to_last = idx === enums.length - 2;
        return <>
            <code>{enum_item}</code>
            {is_last && ''}
            {is_2nd_to_last && ' or '}
            {!is_last && !is_2nd_to_last && ', '}
          </>;
      });
      const enum_list = has_enums && !has_inline_enums && <Accordion {...child_props}>
          {enums.map(enum_item => <>
              <code>{enum_item.name}</code>
              <br />
              <p>{enum_item.description}</p>
            </>)}
        </Accordion>;
      const item_list = has_items && <Expandable {...child_props}>
          <ParamList items={items || []} is_child />
        </Expandable>;
      return <>
          <p>
            {item.description}
            {has_inline_enums && [has_inline_enums.length > 1 ? ' One of ' : ' Must be ', ...has_inline_enums]}
          </p>

          {enum_list}
          {item_list}
        </>;
    };
    return is_child ? <ResponseField {...field_props}>{render_child_item()}</ResponseField> : <ParamField {...field_props}>{render_child_item()}</ParamField>;
  });
};

Creates a new corporation Entity. An Entity can be created with an empty object and progressively updated with more information from your end user.

## Body

<Attributes title="thing" />

<ParamList
  items={[
  {
  name: 'type',
  type: 'string',
  required: true,
  description: 'The type of the Entity.',
  enums: ['corporation'],
  },
  {
  name: 'corporation',
  type: 'object',
  required: true,
  description: 'Corporation information of the Entity.',
  items: [
    {
      name: 'corporation.name',
      type: 'string',
      description: 'The legal name of the corporation Entity.',
    },
    {
      name: 'corporation.dba',
      type: 'string',
      description: 'DBA (Doing Business As) name of the corporation Entity.',
    },
    {
      name: 'corporation.ein',
      type: 'string',
      description: 'The EIN of the corporation Entity.',
    },
    {
      name: 'corporation.owners',
      type: 'object[]',
      description: 'The details of the corporation\'s owners (only include individuals owning 25% or more of the corporation).',
      items: [
        {
          name: 'corporation.owners.first_name',
          type: 'string',
          description: 'The legal first name of the corporation owner.',
        },
        {
          name: 'corporation.owners.last_name',
          type: 'string',
          description: 'The legal last name of the corporation owner.',
        },
        {
          name: 'corporation.owners.phone',
          type: 'string',
          description: 'Mobile phone number of the corporation owner in E.164 format. The number will only be used for KYC / AML verification.',
        },
        {
          name: 'corporation.owners.email',
          type: 'string',
          description: 'Email address of the corporation owner. The email will only be used for KYC / AML verification.',
        },
        {
          name: 'corporation.owners.dob',
          type: 'string',
          description: 'The corporation owner\'s date of birth in ISO 8601 format.',
        },
        {
          name: 'corporation.owners.address',
          type: 'object',
          description: 'The corporation owner\'s address.',
          items: [
            {
              name: 'corporation.owners.address.line1',
              type: 'string',
              description: 'The first line of the corporation owner\'s address.',
            },
            {
              name: 'corporation.owners.address.line2',
              type: 'string',
              description: 'The second line of the corporation owner\'s address.',
            },
            {
              name: 'corporation.owners.address.city',
              type: 'string',
              description: 'The city of the corporation owner\'s address.',
            },
            {
              name: 'corporation.owners.address.state',
              type: 'string',
              description: 'The two-letter abbreviation for the state of the corporation owner\'s address.',
            },
            {
              name: 'corporation.owners.address.zip',
              type: 'string',
              description: 'The ZIP code of the corporation owner\'s address.',
            },
          ],
        },
      ],
    },
  ],
  },
  {
  name: 'address',
  type: 'object',
  description: 'The Entity\'s address.',
  items: [
    {
      name: 'address.line1',
      type: 'string',
      description: 'The first line of the Entity\'s address.',
    },
    {
      name: 'address.line2',
      type: 'string',
      description: 'The second line of the Entity\'s address.',
    },
    {
      name: 'address.city',
      type: 'string',
      description: 'The city of the Entity\'s address.',
    },
    {
      name: 'address.state',
      type: 'string',
      description: 'The two-letter abbreviation for the state of the Entity\'s address.',
    },
    {
      name: 'address.zip',
      type: 'string',
      description: 'The ZIP code of the Entity\'s address.',
    },
  ],
  }
  ]}
/>

## Returns

Returns the Entity associated with the ID.

<RequestExample>
  ```bash cURL
  curl https://production.methodfi.com/entities \
    -X POST \
    -H "Method-Version: 2024-04-04" \
    -H "Authorization: Bearer sk_WyZEWVfTcH7GqmPzUPk65Vjc" \
    -H "Content-Type: application/json" \
    -d '{
      "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"
      }
    }'
  ```

  ```javascript Node.js
  const entity = await method.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',
    },
  });
  ```

  ```python Python
  entity = method.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': None,
            'city': 'Mountain View',
            'state': 'CA',
            'zip': '94043'
          }
        }
      ]
    },
    'address': {
      'line1': '1600 Amphitheatre Parkway',
      'line2': None,
      'city': 'Mountain View',
      'state': 'CA',
      'zip': '94043'
    }
  })
  ```
</RequestExample>

<ResponseExample>
  ```json
  {
    "id": "ent_A6bmTtFmxQhGQ",
    "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"
          }
        }
      ]
    },
    "error": null,
    "address": {
      "line1": "1600 Amphitheatre Parkway",
      "line2": null,
      "city": "Mountain View",
      "state": "CA",
      "zip": "94043"
    },
    "status": "active",
    "metadata": null,
    "created_at": "2023-10-24T21:26:17.225Z",
    "updated_at": "2023-10-24T21:26:17.225Z"
  }
  ```
</ResponseExample>


# Create an Individual

POST https://production.methodfi.com/entities

export const ParamList = ({items, is_child = false}) => {
  return items.map(item => {
    const field_props = {
      id: Math.random().toString(),
      body: item.name,
      name: item.name,
      type: item.type,
      required: item.required
    };
    const enums = item.enums || [];
    const items = item.items || [];
    const has_items = items?.length > 0;
    const has_enums = enums?.length > 0;
    const should_default_open = item.defaultOpen | false;
    const render_child_item = () => {
      const child_props = {
        title: has_enums ? "Possible enum values" : "properties"
      };
      if (should_default_open) child_props.defaultOpen = true;
      const has_inline_enums = has_enums && enums.every(enum_item => typeof enum_item === 'string') && enums.map((enum_item, idx) => {
        const is_last = idx === enums.length - 1;
        const is_2nd_to_last = idx === enums.length - 2;
        return <>
            <code>{enum_item}</code>
            {is_last && ''}
            {is_2nd_to_last && ' or '}
            {!is_last && !is_2nd_to_last && ', '}
          </>;
      });
      const enum_list = has_enums && !has_inline_enums && <Accordion {...child_props}>
          {enums.map(enum_item => <>
              <code>{enum_item.name}</code>
              <br />
              <p>{enum_item.description}</p>
            </>)}
        </Accordion>;
      const item_list = has_items && <Expandable {...child_props}>
          <ParamList items={items || []} is_child />
        </Expandable>;
      return <>
          <p>
            {item.description}
            {has_inline_enums && [has_inline_enums.length > 1 ? ' One of ' : ' Must be ', ...has_inline_enums]}
          </p>

          {enum_list}
          {item_list}
        </>;
    };
    return is_child ? <ResponseField {...field_props}>{render_child_item()}</ResponseField> : <ParamField {...field_props}>{render_child_item()}</ParamField>;
  });
};

Creates a new individual Entity. An Entity can be created with an empty object
and progressively updated with more information from your end user.

<Note>Entities are not checked for existing duplicate Entities.</Note>

## Body

<ParamList
  items={[
  {
    name: "type",
    type: "string",
    required: true,
    description: "The type of the Entity.",
    enums: ["individual"],
  },
  {
    name: "individual",
    type: "object",
    required: true,
    description: "Individual information of the Entity.",
    items: [
      {
        name: "individual.first_name",
        type: "string | null",
        required: false,
        description: "The legal first name of the individual Entity.",
      },
      {
        name: "individual.last_name",
        type: "string | null",
        required: false,
        description: "The legal last name of the individual Entity.",
      },
      {
        name: "individual.phone",
        type: "string | null",
        required: false,
        description: (
          <>
            Mobile phone number of the individual Entity in E.164 format. The
            number will only be used for KYC / AML verification.
            <Note>
              The Entity's phone number must be verified before it can be used for
              creating an Entity.
            </Note>
          </>
        ),
      },
      {
        name: "individual.email",
        type: "string | null",
        required: false,
        description: (
          <>
            Email address of the individual Entity. The email will only be
            used for KYC / AML verification.
          </>
        ),
      },
      {
        name: "individual.dob",
        type: "string | null",
        required: false,
        description: "The Entity's date of birth in ISO 8601 format.",
      },
      {
        name: "individual.ssn_4",
        type: "string | null",
        description: "The last 4 digits of the individual's SSN.",
      },
      {
        name: "individual.ssn",
        type: "string | null",
        description: "The individual's SSN.",
      },
    ],
  },
  {
    name: "address",
    type: "object",
    required: false,
    description: "Address information of the Entity.",
    items: [
      {
        name: "address.line1",
        type: "string | null",
        required: false,
        description: "The first line of the Entity's address.",
      },
      {
        name: "address.line2",
        type: "string | null",
        required: false,
        description: "The second line of the Entity's address.",
      },
      {
        name: "address.city",
        type: "string | null",
        required: false,
        description: "The city of the Entity's address.",
      },
      {
        name: "address.state",
        type: "string | null",
        required: false,
        description:
          "The two-letter abbreviation for the state of the Entity's address.",
      },
      {
        name: "address.zip",
        type: "string | null",
        required: false,
        description: "The ZIP code of the Entity's address.",
      },
    ],
  },
  ]}
/>

## Returns

Returns the Entity associated with the ID.

<RequestExample>
  ```bash cURL
  curl https://production.methodfi.com/entities \
  -X POST \
  -H "Authorization: Bearer sk_WyZEWVfTcH7GqmPzUPk65Vjc" \
  -H "Content-Type: application/json" \
  -d '{
    "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"
    }
  }'
  ```

  ```javascript Node.js
  const entity = await method.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",
    },
  });
  ```

  ```python Python
  entity = method.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': None,
      'city': 'Austin',
      'state': 'TX',
      'zip': '78705'
    }
  })
  ```
</RequestExample>

<ResponseExample>
  ```json
  {
    "id": "ent_BzirqpLEm3BW7",
    "type": "individual",
    "individual": {
      "first_name": "Kevin",
      "last_name": "Doyle",
      "phone": "+15121231113",
      "dob": "1997-03-18",
      "email": "kevin.doyle@gmail.com",
      "ssn_4": null,
      "ssn": null
    },
    "error": null,
    "address": {
      "line1": "3300 N Interstate 35",
      "line2": null,
      "city": "Austin",
      "state": "TX",
      "zip": "78705"
    },
    "status": "incomplete",
    "verification": {
      "identity": {
        "verified": false,
        "matched": false,
        "latest_verification_session": null,
        "methods": [
          "element",
          "kba"
        ]
      },
      "phone": {
        "verified": true,
        "latest_verification_session": "evf_P4QXNj93Y9J8L",
        "methods": []
      }
    },
    "connect": null,
    "credit_score": null,
    "products": [
      "identity"
    ],
    "restricted_products": [
      "connect",
      "credit_score",
      "attribute"
    ],
    "subscriptions": [],
    "available_subscriptions": [
      "connect",
      "credit_score"
    ],
    "restricted_subscriptions": [],
    "metadata": null,
    "created_at": "2023-10-24T21:50:53.024Z",
    "updated_at": "2023-10-24T21:50:53.024Z"
  }
  ```
</ResponseExample>


# Create Individual Credit Scores

POST /entities/{ent_id}/credit_scores

export const ParamList = ({items, is_child = false}) => {
  return items.map(item => {
    const field_props = {
      id: Math.random().toString(),
      body: item.name,
      name: item.name,
      type: item.type,
      required: item.required
    };
    const enums = item.enums || [];
    const items = item.items || [];
    const has_items = items?.length > 0;
    const has_enums = enums?.length > 0;
    const should_default_open = item.defaultOpen | false;
    const render_child_item = () => {
      const child_props = {
        title: has_enums ? "Possible enum values" : "properties"
      };
      if (should_default_open) child_props.defaultOpen = true;
      const has_inline_enums = has_enums && enums.every(enum_item => typeof enum_item === 'string') && enums.map((enum_item, idx) => {
        const is_last = idx === enums.length - 1;
        const is_2nd_to_last = idx === enums.length - 2;
        return <>
            <code>{enum_item}</code>
            {is_last && ''}
            {is_2nd_to_last && ' or '}
            {!is_last && !is_2nd_to_last && ', '}
          </>;
      });
      const enum_list = has_enums && !has_inline_enums && <Accordion {...child_props}>
          {enums.map(enum_item => <>
              <code>{enum_item.name}</code>
              <br />
              <p>{enum_item.description}</p>
            </>)}
        </Accordion>;
      const item_list = has_items && <Expandable {...child_props}>
          <ParamList items={items || []} is_child />
        </Expandable>;
      return <>
          <p>
            {item.description}
            {has_inline_enums && [has_inline_enums.length > 1 ? ' One of ' : ' Must be ', ...has_inline_enums]}
          </p>

          {enum_list}
          {item_list}
        </>;
    };
    return is_child ? <ResponseField {...field_props}>{render_child_item()}</ResponseField> : <ParamField {...field_props}>{render_child_item()}</ParamField>;
  });
};

Creates a new Credit Score request to retrieve the Entity's credit score.

Operation Type: <Tooltip tip="Your request is processed in the background. You'll receive a webhook when it's complete.">⏳ Asynchronous</Tooltip> | [Webhook Payload](overview#webhook-payload).

## Path Parameters

<ParamList
  items={[
  {
  name: 'ent_id',
  type: 'string',
  description: 'The ID of the Entity.'
  }
  ]}
/>

## Returns

Returns an Entity's CreditScore object.

<RequestExample>
  ```bash cURL
  curl https://production.methodfi.com/entities/ent_au22b1fbFJbp8/credit_scores \
    -X POST \
    -H "Method-Version: 2024-04-04" \
    -H "Authorization: Bearer sk_WyZEWVfTcH7GqmPzUPk65Vjc"
  ```

  ```javascript Node.js
  const entity = await method
    .entities('ent_au22b1fbFJbp8')
    .creditScores
    .create();
  ```

  ```python Python
  entity = method
  .entities('ent_au22b1fbFJbp8')
  .credit_scores
  .create()
  ```
</RequestExample>

<ResponseExample>
  ```json
  {
    "id": "crs_pn4ca33GXFaCE",
    "entity_id": "ent_au22b1fbFJbp8",
    "status": "pending",
    "scores": null,
    "error": null,
    "created_at": "2024-04-12T00:12:30.228Z",
    "updated_at": "2024-04-12T00:12:30.228Z"
  }
  ```
</ResponseExample>


# The credit score endpoint



export const credit_score_name = "CreditScore";

export const get_common_parameters = (resource_name = 'resource') => {
  return {
    id: {
      name: 'id',
      type: "string",
      required: false,
      description: `Unique identifier for the ${resource_name}.`
    },
    entity_id: {
      name: 'entity_id',
      type: 'string',
      required: false,
      description: 'The ID of the associated Entity.'
    },
    account_id: {
      name: 'account_id',
      type: 'string',
      required: false,
      description: 'The ID of the associated Account.'
    },
    error: {
      name: 'error',
      type: 'object | null',
      required: false,
      description: <>
          An object representing an error that occurred while processing
          this {resource_name}. See <a href={`/reference/errors/${resource_name.replace(/^([A-Z])/, function (match) {
        return match.toLowerCase();
      }).replace(/([A-Z])/g, function (match) {
        return "-" + match.toLowerCase();
      })}-errors`}>{resource_name} errors</a>.
        </>
    },
    status_error: {
      name: 'status_error',
      type: 'object | null',
      required: false,
      description: <>
          An object representing an error that occurred while processing
          this {resource_name}. See <a href="/reference/errors/product-errors#status-errors">{resource_name} errors</a>.
        </>
    },
    metadata: {
      name: 'metadata',
      type: 'object | null',
      required: false,
      description: <>
          Additional data provided during creation.
          See <a href="/reference/metadata">metadata</a>
        </>
    },
    created_at: {
      name: 'created_at',
      type: 'string',
      required: false,
      description: `Timestamp of when the ${resource_name} was created.`
    },
    updated_at: {
      name: 'updated_at',
      type: 'string',
      required: false,
      description: `Timestamp of when the ${resource_name} was last updated.`
    },
    status: (enums = []) => ({
      name: 'status',
      type: 'enum',
      required: false,
      description: `Status of the ${resource_name}.`,
      enums
    }),
    type: (enums = []) => ({
      name: 'type',
      type: 'enum',
      required: false,
      description: `The type of ${resource_name}.`,
      enums
    })
  };
};

export const ParamList = ({items, is_child = false}) => {
  return items.map(item => {
    const field_props = {
      id: Math.random().toString(),
      body: item.name,
      name: item.name,
      type: item.type,
      required: item.required
    };
    const enums = item.enums || [];
    const items = item.items || [];
    const has_items = items?.length > 0;
    const has_enums = enums?.length > 0;
    const should_default_open = item.defaultOpen | false;
    const render_child_item = () => {
      const child_props = {
        title: has_enums ? "Possible enum values" : "properties"
      };
      if (should_default_open) child_props.defaultOpen = true;
      const has_inline_enums = has_enums && enums.every(enum_item => typeof enum_item === 'string') && enums.map((enum_item, idx) => {
        const is_last = idx === enums.length - 1;
        const is_2nd_to_last = idx === enums.length - 2;
        return <>
            <code>{enum_item}</code>
            {is_last && ''}
            {is_2nd_to_last && ' or '}
            {!is_last && !is_2nd_to_last && ', '}
          </>;
      });
      const enum_list = has_enums && !has_inline_enums && <Accordion {...child_props}>
          {enums.map(enum_item => <>
              <code>{enum_item.name}</code>
              <br />
              <p>{enum_item.description}</p>
            </>)}
        </Accordion>;
      const item_list = has_items && <Expandable {...child_props}>
          <ParamList items={items || []} is_child />
        </Expandable>;
      return <>
          <p>
            {item.description}
            {has_inline_enums && [has_inline_enums.length > 1 ? ' One of ' : ' Must be ', ...has_inline_enums]}
          </p>

          {enum_list}
          {item_list}
        </>;
    };
    return is_child ? <ResponseField {...field_props}>{render_child_item()}</ResponseField> : <ParamField {...field_props}>{render_child_item()}</ParamField>;
  });
};

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

<Info>Enterprise customers can customize their credit score bureau and model selections. Contact your Method CSM for more information.</Info>

**The Credit Score endpoint is available as a:**

| Type           | Use-Case                                                                                           |
| -------------- | -------------------------------------------------------------------------------------------------- |
| `Product`      | On-Demand view of an Entity's credit score.                                                        |
| `Subscription` | Continuous near real-time updates on an Entity's credit score. [Webhook Payload](#webhook-payload) |

## CreditScore Objects

<ParamList
  items={[
  (get_common_parameters(credit_score_name).id),
  (get_common_parameters().entity_id),
  (get_common_parameters(credit_score_name).status(
  enums = [
    {
      name: 'pending',
      description: `The ${credit_score_name} is queued to be retrieved.`
    },
    {
      name: 'in_progress',
      description: `The ${credit_score_name} is being retrieved.`
    },
    {
      name: 'completed',
      description: `The ${credit_score_name} has successfully been retrieved.`
    },
    {
      name: 'failed',
      description: `The ${credit_score_name} failed to be retrieved.`
    }
  ]
  )),
  {
  name: 'scores',
  type:'object[]',
  required: false,
  description: 'An array of score objects.',
  items: [
    {
      name: 'scores.score',
      type: 'number',
      description: 'The credit score.'
    },
    {
      name: 'scores.source',
      type: 'enum',
      description: 'The source of the credit score.',
      enums: [
        {
          name: 'equifax',
          description: 'Equifax is the source used to pull the credit score.'
        },
        {
          name: 'experian',
          description: 'Experian is the source used to pull the credit score.'
        },
        {
          name: 'transunion',
          description: 'TransUnion is the source used to pull the credit score.'
        }
      ]
    },
    {
      name: 'scores.model',
      type: 'enum',
      description: 'The model used to calculate the credit score.',
      enums: [
        {
          name: 'vantage_3',
          description: <><a href="https://www.creditkarma.com/credit-cards/i/vantagescore-30">VantageScore 3.0</a> credit score model.</>,
        },
        {
          name: 'vantage_4',
          description: <><a href="https://www.creditkarma.com/advice/i/new-vantagescore-4-0-explained">VantageScore 4.0</a> credit score model.</>,
        }
      ]
    },
    {
      name: 'scores.factors',
      type: 'object[]',
      description: 'An array of factors that contributed to the credit score.',
      items: [
        {
          name: 'scores.factors.code',
          type: 'string',
          description: 'The code of the factor.'
        },
        {
          name: 'scores.factors.description',
          type: 'string',
          description: 'The description of the factor.'
        }
      ]
    },
    {
      name: 'scores.created_at',
      type: 'string',
      description: 'Timestamp of when the credit score was generated.'
    }
  ]
  },
  (get_common_parameters(credit_score_name).error),
  (get_common_parameters(credit_score_name).created_at),
  (get_common_parameters(credit_score_name).updated_at),
  ]}
/>

## Webhook Payload

The [Webhook](/reference/webhooks/overview) payload will contain the following information:

```json
{
  "id": "string",
  "type": "credit_score.create" | "credit_score.update",
  "path": "/entities/<entity_id>/credit_scores/<crs_id>",
  "event": "<evt_id>"
}
```

<RequestExample>
  ```json THE CREDIT SCORE OBJECT
  {
    "id": "crs_pn4ca33GXFaCE",
    "entity_id": "ent_au22b1fbFJbp8",
    "status": "completed",
    "scores": [
      {
        "score": 734,
        "source": "equifax",
        "model": "vantage_3",
        "factors": [
          {
            "code": "00034",
            "description": "Total of all balances on bankcard or revolving accounts is too high"
          },
          {
            "code": "00012",
            "description": "The date that you opened your oldest account is too recent"
          },
          {
            "code": "00063",
            "description": "Lack of sufficient relevant real estate account information"
          },
          {
            "code": "00016",
            "description": "The total of all balances on your open accounts is too high"
          }
        ],
        "created_at": "2024-04-12T00:12:32.768Z"
      }
    ],
    "error": null,
    "created_at": "2024-04-12T00:12:30.228Z",
    "updated_at": "2024-04-12T00:12:41.303Z"
  }
  ```
</RequestExample>


# Retrieve Individual Credit Scores

GET /entities/{ent_id}/credit_scores/{crs_id}

export const ParamList = ({items, is_child = false}) => {
  return items.map(item => {
    const field_props = {
      id: Math.random().toString(),
      body: item.name,
      name: item.name,
      type: item.type,
      required: item.required
    };
    const enums = item.enums || [];
    const items = item.items || [];
    const has_items = items?.length > 0;
    const has_enums = enums?.length > 0;
    const should_default_open = item.defaultOpen | false;
    const render_child_item = () => {
      const child_props = {
        title: has_enums ? "Possible enum values" : "properties"
      };
      if (should_default_open) child_props.defaultOpen = true;
      const has_inline_enums = has_enums && enums.every(enum_item => typeof enum_item === 'string') && enums.map((enum_item, idx) => {
        const is_last = idx === enums.length - 1;
        const is_2nd_to_last = idx === enums.length - 2;
        return <>
            <code>{enum_item}</code>
            {is_last && ''}
            {is_2nd_to_last && ' or '}
            {!is_last && !is_2nd_to_last && ', '}
          </>;
      });
      const enum_list = has_enums && !has_inline_enums && <Accordion {...child_props}>
          {enums.map(enum_item => <>
              <code>{enum_item.name}</code>
              <br />
              <p>{enum_item.description}</p>
            </>)}
        </Accordion>;
      const item_list = has_items && <Expandable {...child_props}>
          <ParamList items={items || []} is_child />
        </Expandable>;
      return <>
          <p>
            {item.description}
            {has_inline_enums && [has_inline_enums.length > 1 ? ' One of ' : ' Must be ', ...has_inline_enums]}
          </p>

          {enum_list}
          {item_list}
        </>;
    };
    return is_child ? <ResponseField {...field_props}>{render_child_item()}</ResponseField> : <ParamField {...field_props}>{render_child_item()}</ParamField>;
  });
};

Retrieves a Credit Score record for an Entity.

## Path Parameters

<ParamList
  items={[
  {
  name: 'ent_id',
  type: 'string',
  description: 'The ID of the entity.'
  },
  {
  name: 'crs_id',
  type: 'string',
  description: 'The ID of the CreditScore.'
  }
  ]}
/>

## Returns

Returns an Entity's CreditScore object.

<RequestExample>
  ```bash cURL
  curl https://production.methodfi.com/entities/ent_au22b1fbFJbp8/credit_scores/crs_pn4ca33GXFaCE \
    -H "Method-Version: 2024-04-04" \
    -H "Authorization: Bearer sk_WyZEWVfTcH7GqmPzUPk65Vjc"
  ```

  ```javascript Node.js
  const entity = await method
    .entities('ent_au22b1fbFJbp8')
    .creditScores
    .retrieve('crs_pn4ca33GXFaCE');
  ```

  ```python Python
  entity = method
    .entities('ent_au22b1fbFJbp8')
    .credit_scores
    .retrieve('crs_pn4ca33GXFaCE')
  ```
</RequestExample>

<ResponseExample>
  ```json
  {
    "id": "crs_pn4ca33GXFaCE",
    "entity_id": "ent_au22b1fbFJbp8",
    "status": "completed",
    "scores": [
      {
        "score": 734,
        "source": "equifax",
        "model": "vantage_3",
        "factors": [
          {
            "code": "00034",
            "description": "Total of all balances on bankcard or revolving accounts is too high"
          },
          {
            "code": "00012",
            "description": "The date that you opened your oldest account is too recent"
          },
          {
            "code": "00063",
            "description": "Lack of sufficient relevant real estate account information"
          },
          {
            "code": "00016",
            "description": "The total of all balances on your open accounts is too high"
          }
        ],
        "created_at": "2024-04-12T00:12:32.768Z"
      }
    ],
    "error": null,
    "created_at": "2024-04-12T00:12:30.228Z",
    "updated_at": "2024-04-12T00:12:41.303Z"
  }
  ```
</ResponseExample>


# Create Identities

POST /entities/{ent_id}/identities

export const identity_name = "Identity";

export const ParamList = ({items, is_child = false}) => {
  return items.map(item => {
    const field_props = {
      id: Math.random().toString(),
      body: item.name,
      name: item.name,
      type: item.type,
      required: item.required
    };
    const enums = item.enums || [];
    const items = item.items || [];
    const has_items = items?.length > 0;
    const has_enums = enums?.length > 0;
    const should_default_open = item.defaultOpen | false;
    const render_child_item = () => {
      const child_props = {
        title: has_enums ? "Possible enum values" : "properties"
      };
      if (should_default_open) child_props.defaultOpen = true;
      const has_inline_enums = has_enums && enums.every(enum_item => typeof enum_item === 'string') && enums.map((enum_item, idx) => {
        const is_last = idx === enums.length - 1;
        const is_2nd_to_last = idx === enums.length - 2;
        return <>
            <code>{enum_item}</code>
            {is_last && ''}
            {is_2nd_to_last && ' or '}
            {!is_last && !is_2nd_to_last && ', '}
          </>;
      });
      const enum_list = has_enums && !has_inline_enums && <Accordion {...child_props}>
          {enums.map(enum_item => <>
              <code>{enum_item.name}</code>
              <br />
              <p>{enum_item.description}</p>
            </>)}
        </Accordion>;
      const item_list = has_items && <Expandable {...child_props}>
          <ParamList items={items || []} is_child />
        </Expandable>;
      return <>
          <p>
            {item.description}
            {has_inline_enums && [has_inline_enums.length > 1 ? ' One of ' : ' Must be ', ...has_inline_enums]}
          </p>

          {enum_list}
          {item_list}
        </>;
    };
    return is_child ? <ResponseField {...field_props}>{render_child_item()}</ResponseField> : <ParamField {...field_props}>{render_child_item()}</ParamField>;
  });
};

Creates a new Identity request to retrieve the identity of an Entity, based off the PII that has been passed in to Method so far.

Operation Type: <Tooltip tip="Your request is processed immediately, and you'll receive a response before proceeding.">⚡ Synchronous</Tooltip>

## Path Parameters

<ParamList
  items={[
  {
    name: "ent_id",
    type: "string",
    description: `The ID of the Entity.`,
  },
  ]}
/>

## Returns

Returns an {identity_name} object.

<RequestExample>
  ```bash cURL
  curl https://production.methodfi.com/entities/ent_au22b1fbFJbp8/identities \
    -X POST \
    -H "Authorization: Bearer sk_WyZEWVfTcH7GqmPzUPk65Vjc"
  ```

  ```javascript Node.js
  const entity = await method
    .entities("ent_au22b1fbFJbp8")
    .identities
    .create();
  ```

  ```python Python
  entity = method
    .entities('ent_au22b1fbFJbp8')
    .identities
    .create()
  ```
</RequestExample>

<ResponseExample>
  ```json
  {
    "id": "idn_NhTRUVEknYaFM",
    "entity_id": "ent_au22b1fbFJbp8",
    "status": "completed",
    "identities": [
      {
        "first_name": "KEVIN",
        "last_name": "DOYLE",
        "dob": "1997-03-18",
        "ssn": "111223333",
        "phone": "+16505551115",
        "address": {
          "address": "3300 N INTERSTATE 35",
          "city": "AUSTIN",
          "postal_code": "78705",
          "state": "TX"
        }
      }
    ],
    "error": null,
    "created_at": "2024-01-16T19:36:08.263Z",
    "updated_at": "2024-01-16T19:36:08.263Z"
  }
  ```
</ResponseExample>


# The identities endpoint



export const identity_name = "Identity";

export const get_common_parameters = (resource_name = 'resource') => {
  return {
    id: {
      name: 'id',
      type: "string",
      required: false,
      description: `Unique identifier for the ${resource_name}.`
    },
    entity_id: {
      name: 'entity_id',
      type: 'string',
      required: false,
      description: 'The ID of the associated Entity.'
    },
    account_id: {
      name: 'account_id',
      type: 'string',
      required: false,
      description: 'The ID of the associated Account.'
    },
    error: {
      name: 'error',
      type: 'object | null',
      required: false,
      description: <>
          An object representing an error that occurred while processing
          this {resource_name}. See <a href={`/reference/errors/${resource_name.replace(/^([A-Z])/, function (match) {
        return match.toLowerCase();
      }).replace(/([A-Z])/g, function (match) {
        return "-" + match.toLowerCase();
      })}-errors`}>{resource_name} errors</a>.
        </>
    },
    status_error: {
      name: 'status_error',
      type: 'object | null',
      required: false,
      description: <>
          An object representing an error that occurred while processing
          this {resource_name}. See <a href="/reference/errors/product-errors#status-errors">{resource_name} errors</a>.
        </>
    },
    metadata: {
      name: 'metadata',
      type: 'object | null',
      required: false,
      description: <>
          Additional data provided during creation.
          See <a href="/reference/metadata">metadata</a>
        </>
    },
    created_at: {
      name: 'created_at',
      type: 'string',
      required: false,
      description: `Timestamp of when the ${resource_name} was created.`
    },
    updated_at: {
      name: 'updated_at',
      type: 'string',
      required: false,
      description: `Timestamp of when the ${resource_name} was last updated.`
    },
    status: (enums = []) => ({
      name: 'status',
      type: 'enum',
      required: false,
      description: `Status of the ${resource_name}.`,
      enums
    }),
    type: (enums = []) => ({
      name: 'type',
      type: 'enum',
      required: false,
      description: `The type of ${resource_name}.`,
      enums
    })
  };
};

export const ParamList = ({items, is_child = false}) => {
  return items.map(item => {
    const field_props = {
      id: Math.random().toString(),
      body: item.name,
      name: item.name,
      type: item.type,
      required: item.required
    };
    const enums = item.enums || [];
    const items = item.items || [];
    const has_items = items?.length > 0;
    const has_enums = enums?.length > 0;
    const should_default_open = item.defaultOpen | false;
    const render_child_item = () => {
      const child_props = {
        title: has_enums ? "Possible enum values" : "properties"
      };
      if (should_default_open) child_props.defaultOpen = true;
      const has_inline_enums = has_enums && enums.every(enum_item => typeof enum_item === 'string') && enums.map((enum_item, idx) => {
        const is_last = idx === enums.length - 1;
        const is_2nd_to_last = idx === enums.length - 2;
        return <>
            <code>{enum_item}</code>
            {is_last && ''}
            {is_2nd_to_last && ' or '}
            {!is_last && !is_2nd_to_last && ', '}
          </>;
      });
      const enum_list = has_enums && !has_inline_enums && <Accordion {...child_props}>
          {enums.map(enum_item => <>
              <code>{enum_item.name}</code>
              <br />
              <p>{enum_item.description}</p>
            </>)}
        </Accordion>;
      const item_list = has_items && <Expandable {...child_props}>
          <ParamList items={items || []} is_child />
        </Expandable>;
      return <>
          <p>
            {item.description}
            {has_inline_enums && [has_inline_enums.length > 1 ? ' One of ' : ' Must be ', ...has_inline_enums]}
          </p>

          {enum_list}
          {item_list}
        </>;
    };
    return is_child ? <ResponseField {...field_props}>{render_child_item()}</ResponseField> : <ParamField {...field_props}>{render_child_item()}</ParamField>;
  });
};

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.

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

**The Identity endpoint is available as a:**

| Type      | Use-Case                                        |
| --------- | ----------------------------------------------- |
| `Product` | Retrieve the full Identity (PII) for any Entity |

## Identity Objects

<ParamList
  items={[
  get_common_parameters(identity_name).id,
  get_common_parameters().entity_id,
  get_common_parameters(identity_name).status(
    (enums = [
      {
        name: "pending",
        description: `The ${identity_name} is queued to be retrieved.`,
      },
      {
        name: "in_progress",
        description: `The ${identity_name} is being retrieved.`,
      },
      {
        name: "completed",
        description: `The ${identity_name} has successfully been retrieved.`,
      },
      {
        name: "failed",
        description: `The ${identity_name} failed to be retrieved.`,
      },
    ])
  ),
  {
    name: "identities",
    type: "object[] | null",
    description: "An array of identity objects.",
    items: [
      {
        name: "identities.first_name",
        type: "string",
        description: "The legal first name of the identity.",
      },
      {
        name: "identities.last_name",
        type: "string",
        description: "The legal last name of the identity.",
      },
      {
        name: "identities.dob",
        type: "string",
        description: "The identity's date of birth in ISO 8601 format.",
      },
      {
        name: "identities.ssn",
        type: "string",
        description: "The identity's SSN.",
      },
      {
        name: "identities.phone",
        type: "string",
        description:
          "Mobile phone number of the identity in E.164 format. The number will only be used for KYC / AML verification.",
      },
      {
        name: "identities.address",
        type: "object | null",
        description: "The identity's address.",
        items: [
          {
            name: "identities.address.address",
            type: "string",
            description: "The number and street of the identity's address.",
          },
          {
            name: "identities.address.city",
            type: "string",
            description: "The city of the identity's address.",
          },
          {
            name: "identities.address.postal_code",
            type: "string",
            description: "The postal code of the identity's address.",
          },
          {
            name: "identities.address.state",
            type: "string",
            description:
              "The two-letter abbreviation for the state of the identity's address.",
          },
        ],
      },
    ],
  },
  get_common_parameters(identity_name).error,
  get_common_parameters(identity_name).created_at,
  get_common_parameters(identity_name).updated_at,
  ]}
/>

<RequestExample>
  ```json THE IDENTITY OBJECT
  {
    "id": "idn_NhTRUVEknYaFM",
    "entity_id": "ent_au22b1fbFJbp8",
    "status": "completed",
    "identities": [
      {
        "first_name": "KEVIN",
        "last_name": "DOYLE",
        "dob": "1997-03-18",
        "ssn": "111223333",
        "phone": "+16505551115",
        "address": {
          "address": "3300 N INTERSTATE 35",
          "city": "AUSTIN",
          "postal_code": "78705",
          "state": "TX"
        }
      },
      {
        "first_name": "JOE",
        "last_name": "DOYLE",
        "dob": "1997-03-18",
        "ssn": "123456789",
        "phone": "+16505551115",
        "address": {
          "address": "3300 N INTERSTATE 35",
          "city": "AUSTIN",
          "postal_code": "78705",
          "state": "TX"
        }
      }
    ],
    "error": null,
    "created_at": "2024-01-16T19:36:08.263Z",
    "updated_at": "2024-01-16T19:36:08.263Z"
  }
  ```
</RequestExample>


# Retrieve Identities

GET /entities/{ent_id}/identities/{idn_id}

export const identity_name = "Identity";

export const ParamList = ({items, is_child = false}) => {
  return items.map(item => {
    const field_props = {
      id: Math.random().toString(),
      body: item.name,
      name: item.name,
      type: item.type,
      required: item.required
    };
    const enums = item.enums || [];
    const items = item.items || [];
    const has_items = items?.length > 0;
    const has_enums = enums?.length > 0;
    const should_default_open = item.defaultOpen | false;
    const render_child_item = () => {
      const child_props = {
        title: has_enums ? "Possible enum values" : "properties"
      };
      if (should_default_open) child_props.defaultOpen = true;
      const has_inline_enums = has_enums && enums.every(enum_item => typeof enum_item === 'string') && enums.map((enum_item, idx) => {
        const is_last = idx === enums.length - 1;
        const is_2nd_to_last = idx === enums.length - 2;
        return <>
            <code>{enum_item}</code>
            {is_last && ''}
            {is_2nd_to_last && ' or '}
            {!is_last && !is_2nd_to_last && ', '}
          </>;
      });
      const enum_list = has_enums && !has_inline_enums && <Accordion {...child_props}>
          {enums.map(enum_item => <>
              <code>{enum_item.name}</code>
              <br />
              <p>{enum_item.description}</p>
            </>)}
        </Accordion>;
      const item_list = has_items && <Expandable {...child_props}>
          <ParamList items={items || []} is_child />
        </Expandable>;
      return <>
          <p>
            {item.description}
            {has_inline_enums && [has_inline_enums.length > 1 ? ' One of ' : ' Must be ', ...has_inline_enums]}
          </p>

          {enum_list}
          {item_list}
        </>;
    };
    return is_child ? <ResponseField {...field_props}>{render_child_item()}</ResponseField> : <ParamField {...field_props}>{render_child_item()}</ParamField>;
  });
};

Retrieves an {identity_name} request with the matched identity for an Entity.

## Path Parameters

<ParamList
  items={[
  {
  name: 'ent_id',
  type: 'string',
  description: `The ID of the Entity.`
  },
  {
  name: 'idn_id',
  type: 'string',
  description: `The ID of the ${identity_name}.`
  }
  ]}
/>

## Returns

Returns an {identity_name} object.

<RequestExample>
  ```bash cURL
  curl https://production.methodfi.com/entities/ent_au22b1fbFJbp8/identities/idn_NhTRUVEknYaFM \
    -H "Method-Version: 2024-04-04" \
    -H "Authorization: Bearer sk_WyZEWVfTcH7GqmPzUPk65Vjc"
  ```

  ```javascript Node.js
  const entity = await method
    .entities('ent_au22b1fbFJbp8')
    .identities
    .retrieve('idn_NhTRUVEknYaFM');
  ```

  ```python Python
  entity = method
    .entities('ent_au22b1fbFJbp8')
    .identities
    .retrieve('idn_NhTRUVEknYaFM')
  ```
</RequestExample>

<ResponseExample>
  ```json
  {
    "id": "idn_NhTRUVEknYaFM",
    "entity_id": "ent_au22b1fbFJbp8",
    "status": "completed",
    "identities": [
      {
        "first_name": "KEVIN",
        "last_name": "DOYLE",
        "dob": "1997-03-18",
        "ssn": "111223333",
        "phone": "+16505551115",
        "address": {
          "address": "3300 N INTERSTATE 35",
          "city": "AUSTIN",
          "postal_code": "78705",
          "state": "TX"
        }
      }
    ],
    "error": null,
    "created_at": "2024-01-16T19:36:08.263Z",
    "updated_at": "2024-01-16T19:36:08.263Z"
  }
  ```
</ResponseExample>


# List all Entities

GET https://production.methodfi.com/entities

export const get_pagination_defaults = (resource_name = 'records') => [{
  name: 'from_date',
  type: 'string',
  required: false,
  description: `ISO 8601 formatted date (YYYY-MM-DD) to filter for ${resource_name} created on and after the date provided.`
}, {
  name: 'to_date',
  type: 'string',
  required: false,
  description: `ISO 8601 formatted date (YYYY-MM-DD) to filter for ${resource_name} created on and before the date provided.`
}, {
  name: 'page',
  type: 'string',
  required: false,
  description: `The number of the page to return.`
}, {
  name: 'page_cursor',
  type: 'string',
  required: false,
  description: <>
        The ID of a resource from which a page should start or end. Mutually exclusive with <code>page</code>.
      </>
}, {
  name: 'page_limit',
  type: 'string',
  required: false,
  description: `The number of ${resource_name} to return per page.`
}];

export const ExpandableFieldsQueryParams = (resource_type = 'all') => {
  const entity = [{
    name: 'connect',
    description: <>This is an <a href="/reference/entities/overview">Entity</a> property, and refers to the <a href="/reference/entities/connect/overview#connect-objects">Connect Object</a>.</>
  }, {
    name: 'credit_score',
    description: <>This is an <a href="/reference/entities/overview">Entity</a> property, and refers to the <a href="/reference/entities/credit-scores/overview#creditscore-objects">CreditScore Object</a>.</>
  }, {
    name: 'attribute',
    description: <>This is an <a href="/reference/entities/overview">Entity</a> property, and refers to the <a href="/reference/entities/attributes/overview#attribute-objects">Attribute Object</a>.</>
  }, {
    name: 'identity_latest_verification_session',
    description: <>This is an <a href="/reference/entities/overview">Entity</a> property, and refers to the <a href="/reference/entities/verification-sessions/overview#entity-verification-session-objects">EntityVerificationSession Object</a>.</>
  }, {
    name: 'phone_latest_verification_session',
    description: <>This is an <a href="/reference/entities/overview">Entity</a> property, and refers to the <a href="/reference/entities/verification-sessions/overview#entity-verification-session-objects">EntityVerificationSession Object</a>.</>
  }];
  const account = [{
    name: 'sensitive',
    description: <>This is an <a href="/reference/accounts/overview">Account</a> property, and refers to the <a href="/reference/accounts/sensitive/overview#sensitive-objects">Sensitive Object</a>.</>
  }, {
    name: 'balance',
    description: <>This is an <a href="/reference/accounts/overview">Account</a> property, and refers to the <a href="/reference/accounts/balances/overview#balances-objects">Balance Object</a>.</>
  }, {
    name: 'card_brand',
    description: <>This is an <a href="/reference/accounts/overview">Account</a> property, and refers to the <a href="/reference/accounts/card-brands/overview#cardbrand-objects">CardBrand Object</a>.</>
  }, {
    name: 'payoff',
    description: <>This is an <a href="/reference/accounts/overview">Account</a> property, and refers to the <a href="/reference/accounts/payoffs/overview#payoff-objects">Payoff Object</a>.</>
  }, {
    name: 'transactions',
    description: <>This is an <a href="/reference/accounts/overview">Account</a> property, and refers to the <a href="/reference/accounts/transactions/overview#transaction-objects">Transaction Object</a>.</>
  }, {
    name: 'update',
    description: <>This is an <a href="/reference/accounts/overview">Account</a> property, and refers to the <a href="/reference/accounts/updates/overview#update-objects">Update Object</a>.</>
  }, {
    name: 'latest_verification_session',
    description: <>This is an <a href="/reference/accounts/overview">Account</a> property, and refers to the <a href="/reference/accounts/verification-sessions/overview#accountverificationsession-objects">AccountVerificationSession Object</a>.</>
  }];
  const ExpandableFieldsByResourceType = {
    entity,
    account,
    all: Array.from(new Set([...entity, ...account]))
  };
  return {
    name: "expand",
    type: "enum[]",
    description: <>
        Attributes that can be expanded into an object to
        provide additional information.
      </>,
    enums: [...ExpandableFieldsByResourceType[resource_type].map(expandable_field => ({
      ...expandable_field
    }))]
  };
};

export const ParamList = ({items, is_child = false}) => {
  return items.map(item => {
    const field_props = {
      id: Math.random().toString(),
      body: item.name,
      name: item.name,
      type: item.type,
      required: item.required
    };
    const enums = item.enums || [];
    const items = item.items || [];
    const has_items = items?.length > 0;
    const has_enums = enums?.length > 0;
    const should_default_open = item.defaultOpen | false;
    const render_child_item = () => {
      const child_props = {
        title: has_enums ? "Possible enum values" : "properties"
      };
      if (should_default_open) child_props.defaultOpen = true;
      const has_inline_enums = has_enums && enums.every(enum_item => typeof enum_item === 'string') && enums.map((enum_item, idx) => {
        const is_last = idx === enums.length - 1;
        const is_2nd_to_last = idx === enums.length - 2;
        return <>
            <code>{enum_item}</code>
            {is_last && ''}
            {is_2nd_to_last && ' or '}
            {!is_last && !is_2nd_to_last && ', '}
          </>;
      });
      const enum_list = has_enums && !has_inline_enums && <Accordion {...child_props}>
          {enums.map(enum_item => <>
              <code>{enum_item.name}</code>
              <br />
              <p>{enum_item.description}</p>
            </>)}
        </Accordion>;
      const item_list = has_items && <Expandable {...child_props}>
          <ParamList items={items || []} is_child />
        </Expandable>;
      return <>
          <p>
            {item.description}
            {has_inline_enums && [has_inline_enums.length > 1 ? ' One of ' : ' Must be ', ...has_inline_enums]}
          </p>

          {enum_list}
          {item_list}
        </>;
    };
    return is_child ? <ResponseField {...field_props}>{render_child_item()}</ResponseField> : <ParamField {...field_props}>{render_child_item()}</ParamField>;
  });
};

Returns all the Entities associated with your team, or an empty array if none have been created.

## Query Parameters

<ParamList
  items={[
  {
    name: "type",
    type: "string",
    required: false,
    description: "The type of Entities to retrieve.",
    enums: ["individual", "corporation"],
  },
  {
    name: "status",
    type: "string",
    required: false,
    description: "The status of Entities to retrieve.",
    enums: ["active", "incomplete", "disabled"],
  },
  ...get_pagination_defaults('Entities'),
  ExpandableFieldsQueryParams('entity'),
  ]}
/>

## Returns

Returns a list of Entities.

<RequestExample>
  ```bash cURL
  curl https://production.methodfi.com/entities \
    -H "Method-Version: 2024-04-04" \
    -H "Authorization: Bearer sk_WyZEWVfTcH7GqmPzUPk65Vjc"
  ```

  ```javascript Node.js
  const entities = await method.entities.list();
  ```

  ```python Python
  entities = method.entities.list()
  ```
</RequestExample>

<ResponseExample>
  ```json
  {
    "data": [
      {
        "id": "ent_76kPG9mJyyGYL",
        "type": "individual",
        "individual": {
            "first_name": "Kevin",
            "last_name": "Doyle",
            "phone": "+15121231111",
            "dob": "1997-03-18",
            "email": "kevin.doyle@gmail.com",
            "ssn_4": null,
            "ssn": "xxxxxxxxx"
        },
        "error": null,
        "address": {
            "line1": "3300 N Interstate 35",
            "line2": null,
            "city": "Austin",
            "state": "TX",
            "zip": "78705"
        },
        "status": "active",
        "verification": {
          "identity": {
            "verified": true,
            "matched": true,
            "latest_verification_session": "evf_mQ6yr6VVJLNEb",
            "methods": []
          },
          "phone": {
            "verified": true,
            "latest_verification_session": "evf_P4QXNj93Y9J8L",
            "methods": []
          }
        },
        "connect": null,
        "credit_score": null,
        "products": [
          "connect",
          "credit_score",
          "identity"
        ],
        "restricted_products": [
          "attribute"
        ],
        "subscriptions": [
          "connect"
        ],
        "available_subscriptions": [],
        "restricted_subscriptions": [
          "credit_score"
        ],
        "metadata": null,
        "created_at": "2023-10-23T05:46:14.550Z",
        "updated_at": "2023-10-23T05:46:14.550Z"
      },
      {
        "id": "ent_A6bmTtFmxQhGQ",
        "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"
              }
            }
          ]
        },
        "error": null,
        "address": {
          "line1": "1600 Amphitheatre Parkway",
          "line2": null,
          "city": "Mountain View",
          "state": "CA",
          "zip": "94043"
        },
        "status": "active",
        "metadata": null,
        "created_at": "2023-10-24T21:26:17.225Z",
        "updated_at": "2023-10-24T21:26:17.225Z"
      } ,
      {
        "id": "ent_mxp3B3yyKLHTH",
        "type": "individual",
        "individual": {
            "first_name": "Alex",
            "last_name": "Kennedy",
            "phone": "+19565555555",
            "dob": "1985-04-23",
            "email": "alex.kennedy@hey.com",
            "ssn_4": null,
            "ssn": null
        },
        "error": null,
        "address": {
            "line1": "1 Hacker Way",
            "line2": null,
            "city": "Menlo Park",
            "state": "CA",
            "zip": "94025"
        },
        "status": "active",
        "verification": {
          "identity": {
            "verified": true,
            "matched": true,
            "latest_verification_session": "evf_mQ6yr6VVJLNEb",
            "methods": []
          },
          "phone": {
            "verified": true,
            "latest_verification_session": "evf_P4QXNj93Y9J8L",
            "methods": []
          }
        },
        "connect": null,
        "credit_score": null,
        "products": [
          "connect",
          "credit_score"
        ],
        "restricted_products": [
          "identity"
        ],
        "subscriptions": [],
        "available_subscriptions": [
          "connect",
          "credit_score"
        ],
        "restricted_subscriptions": [],
        "metadata": null,
        "created_at": "2023-10-23T05:46:14.550Z",
        "updated_at": "2023-10-23T05:46:14.550Z"
      }
    ]
  }
  ```
</ResponseExample>


# The entity endpoint



export const get_common_parameters = (resource_name = 'resource') => {
  return {
    id: {
      name: 'id',
      type: "string",
      required: false,
      description: `Unique identifier for the ${resource_name}.`
    },
    entity_id: {
      name: 'entity_id',
      type: 'string',
      required: false,
      description: 'The ID of the associated Entity.'
    },
    account_id: {
      name: 'account_id',
      type: 'string',
      required: false,
      description: 'The ID of the associated Account.'
    },
    error: {
      name: 'error',
      type: 'object | null',
      required: false,
      description: <>
          An object representing an error that occurred while processing
          this {resource_name}. See <a href={`/reference/errors/${resource_name.replace(/^([A-Z])/, function (match) {
        return match.toLowerCase();
      }).replace(/([A-Z])/g, function (match) {
        return "-" + match.toLowerCase();
      })}-errors`}>{resource_name} errors</a>.
        </>
    },
    status_error: {
      name: 'status_error',
      type: 'object | null',
      required: false,
      description: <>
          An object representing an error that occurred while processing
          this {resource_name}. See <a href="/reference/errors/product-errors#status-errors">{resource_name} errors</a>.
        </>
    },
    metadata: {
      name: 'metadata',
      type: 'object | null',
      required: false,
      description: <>
          Additional data provided during creation.
          See <a href="/reference/metadata">metadata</a>
        </>
    },
    created_at: {
      name: 'created_at',
      type: 'string',
      required: false,
      description: `Timestamp of when the ${resource_name} was created.`
    },
    updated_at: {
      name: 'updated_at',
      type: 'string',
      required: false,
      description: `Timestamp of when the ${resource_name} was last updated.`
    },
    status: (enums = []) => ({
      name: 'status',
      type: 'enum',
      required: false,
      description: `Status of the ${resource_name}.`,
      enums
    }),
    type: (enums = []) => ({
      name: 'type',
      type: 'enum',
      required: false,
      description: `The type of ${resource_name}.`,
      enums
    })
  };
};

export const ExpandableFieldsList = ({resource_type}) => {
  const ExpandableFieldsByResourceType = {
    entity: ['connect', 'credit_score'],
    account: ['sensitive', 'balance', 'card_brand', 'payoff', 'transactions', 'update', 'latest_verification_session']
  };
  const ExpandableFieldsNameToValues = {
    connect: {
      key_name: 'connect',
      object_name: 'Connect'
    },
    credit_score: {
      key_name: 'credit_score',
      object_name: 'CreditScore'
    },
    sensitive: {
      key_name: 'sensitive',
      object_name: 'Sensitive'
    },
    balance: {
      key_name: 'balance',
      object_name: 'Balance'
    },
    card_brand: {
      key_name: 'card_brand',
      object_name: 'CardBrand'
    },
    payoff: {
      key_name: 'payoff',
      object_name: 'Payoff'
    },
    transactions: {
      key_name: 'transactions',
      object_name: 'Transaction'
    },
    update: {
      key_name: 'update',
      object_name: 'Update'
    },
    latest_verification_session: {
      key_name: 'latest_verification_session',
      object_name: 'AccountVerificationSession'
    }
  };
  const ExpandableFields = field_name => <ParamField body={ExpandableFieldsNameToValues[field_name].key_name} type="string | null">
        <>
          ID of the {ExpandableFieldsNameToValues[field_name].object_name} record.{" "}
          <Tooltip tip="This can be expanded into an object with the expand query parameter.">
            <a href="/reference/expanding">Expandable</a>
          </Tooltip>.
        </>
    </ParamField>;
  return ExpandableFieldsByResourceType[resource_type].map(field_name => {
    return ExpandableFields(field_name);
  });
};

export const ParamList = ({items, is_child = false}) => {
  return items.map(item => {
    const field_props = {
      id: Math.random().toString(),
      body: item.name,
      name: item.name,
      type: item.type,
      required: item.required
    };
    const enums = item.enums || [];
    const items = item.items || [];
    const has_items = items?.length > 0;
    const has_enums = enums?.length > 0;
    const should_default_open = item.defaultOpen | false;
    const render_child_item = () => {
      const child_props = {
        title: has_enums ? "Possible enum values" : "properties"
      };
      if (should_default_open) child_props.defaultOpen = true;
      const has_inline_enums = has_enums && enums.every(enum_item => typeof enum_item === 'string') && enums.map((enum_item, idx) => {
        const is_last = idx === enums.length - 1;
        const is_2nd_to_last = idx === enums.length - 2;
        return <>
            <code>{enum_item}</code>
            {is_last && ''}
            {is_2nd_to_last && ' or '}
            {!is_last && !is_2nd_to_last && ', '}
          </>;
      });
      const enum_list = has_enums && !has_inline_enums && <Accordion {...child_props}>
          {enums.map(enum_item => <>
              <code>{enum_item.name}</code>
              <br />
              <p>{enum_item.description}</p>
            </>)}
        </Accordion>;
      const item_list = has_items && <Expandable {...child_props}>
          <ParamList items={items || []} is_child />
        </Expandable>;
      return <>
          <p>
            {item.description}
            {has_inline_enums && [has_inline_enums.length > 1 ? ' One of ' : ' Must be ', ...has_inline_enums]}
          </p>

          {enum_list}
          {item_list}
        </>;
    };
    return is_child ? <ResponseField {...field_props}>{render_child_item()}</ResponseField> : <ParamField {...field_props}>{render_child_item()}</ParamField>;
  });
};

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.

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

#### 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.

## Entity Objects

<Tabs>
  <Tab title="Individual">
    <ParamList
      items={[
      get_common_parameters("Entity").id,
      get_common_parameters("Entity").type(["individual"]),
      {
        name: "individual",
        type: "object | null",
        description: "Individual information of the Entity.",
        items: [
          {
            name: "individual.first_name",
            type: "string | null",
            description: "The legal first name of the individual.",
          },
          {
            name: "individual.last_name",
            type: "string | null",
            description: "The legal last name of the individual.",
          },
          {
            name: "individual.phone",
            type: "string | null",
            description:
              "Mobile phone number of the individual in E.164 format. The number will only be used for KYC / AML verification.",
          },
          {
            name: "individual.dob",
            type: "string | null",
            description: "The individual's date of birth in ISO 8601 format.",
          },
          {
            name: "individual.email",
            type: "string | null",
            description:
              "Email address of the individual. The email will only be used for KYC / AML verification.",
          },
          {
            name: "individual.ssn_4",
            type: "string | null",
            description: (
              <>
                The last 4 digits of the individual's SSN. This field is
                hidden after the SSN 4 is provided, and can be accessed via{" "}
                <a href="/reference/entities/identities/retrieve">
                  Entity Identity
                </a>
                .
              </>
            ),
          },
          {
            name: "individual.ssn",
            type: "string | null",
            description: (
              <>
                The individual's SSN. This field is hidden after the SSN is provided, and can be accessed
                via{" "}
                <a href="/reference/entities/identities/retrieve">
                  Entity Identity
                </a>
                .
              </>
            ),
          },
        ],
      },
      get_common_parameters("Entity").error,
      {
        name: "address",
        type: "object | null",
        description: "The Entity's address.",
        items: [
          {
            name: "address.line1",
            type: "string",
            description: "The first line of the Entity's address.",
          },
          {
            name: "address.line2",
            type: "string",
            description: "The second line of the Entity's address.",
          },
          {
            name: "address.city",
            type: "string",
            description: "The city of the Entity's address.",
          },
          {
            name: "address.state",
            type: "string",
            description:
              "The two-letter abbreviation for the state of the Entity's address.",
          },
          {
            name: "address.zip",
            type: "string",
            description: "The ZIP code of the Entity's address.",
          },
        ],
      },
      get_common_parameters("Entity").status([
        {
          name: "active",
          description: (
              <>
                The Entity has completed all <code>Verification</code> and can access most of Method's products. Verification requirements
                are set on a team-by-team basis and some verification might be auto populated.
              </>
          ),
      },
        {
          name: "incomplete",
          description: (
              <>
                  The Entity has not completed all <code>Verification</code> requirements based on the PII provided and your team's restrictions.
              </>
          )
        },
        {
          name: "disabled",
          description: (
            <>
              The Entity has been disabled and no longer has access to Method's products.
              Entities can transition into the <code>disabled</code> status if
              an Entity withdraws consent (via the Consent endpoint or via a Payment failure)
            </>
          ),
        },
      ]),
      {
        name: "verification",
        type: "object",
        description: "Verification status of the Entity. Verification requirements are set on a team-by-team basis.",
        items: [
          {
            name: "verification.identity",
            type: "object",
            description: "Identity verification status for the Entity.",
            items: [
              {
                name: "verification.identity.verified",
                type: "boolean",
                description:
                  "The Entity's identity, who they claim to be, has been verified.",
              },
              {
                name: "verification.identity.matched",
                type: "boolean",
                description:
                  "The Entity's identity has been matched through a Method trusted provider.",
              },
              {
                name: "verification.identity.latest_verification_session",
                type: "string | null",
                description: (
                  <>
                    The ID of the latest verification session for the Entity's
                    identity.{" "}
                    <Tooltip tip="This can be expanded into an object with the expand query parameter.">
                      <a href="/reference/expanding">Expandable</a>
                    </Tooltip>
                    .
                  </>
                ),
              },
              {
                name: "verification.identity.methods",
                type: "string[]",
                description: (
                  <>
                    The{" "}
                    <a href="/reference/entities/verification-sessions/overview#verification-methods">
                      Verification Methods
                    </a>{" "}
                    that the Entity can use to verify their identity. Verification and the available methods are unique on a team-by-team basis.
                  </>
                ),
                enums: ['kba', 'byo_kyc', 'element'],
              },
            ],
          },
          {
            name: "verification.phone",
            type: "object",
            description: "Phone verification status for the Entity.",
            items: [
              {
                name: "verification.phone.verified",
                type: "boolean",
                description: "The Entity's phone number has been verified.",
              },
              {
                name: "verification.phone.latest_verification_session",
                type: "string | null",
                description: (
                  <>
                    The ID of the latest verification session for the Entity's
                    phone number.{" "}
                    <Tooltip tip="This can be expanded into an object with the expand query parameter.">
                      <a href="/reference/expanding">Expandable</a>
                    </Tooltip>
                    .
                  </>
                ),
              },
              {
                name: "verification.phone.methods",
                type: "string[]",
                description: (
                  <>
                    The{" "}
                    <a href="/reference/entities/verification-sessions/overview#verification-methods">
                      Verification Methods
                    </a>{" "}
                    that the Entity can use to verify their phone number. Verification and the available methods are unique on a team-by-team basis.
                  </>
                ),
                enums: ['sms', 'sna', 'byo_sms'],
              },
            ],
          },
        ],
      },
      ]}
    />

    <ExpandableFieldsList resource_type="entity" />

    <ParamList
      items={[
      {
        name: "products",
        type: "string[]",
        description: (
          <>
            A list of products that the Entity has access to. See{" "}
            <a href="/reference/entities/products/overview#product-names">
              Product Names
            </a>
            .
          </>
        ),
      },
      {
        name: "restricted_products",
        type: "string[]",
        description: (
          <>
            A list of products that the Entity can have access to but is
            missing some requirements. (e.g. Missing <code>Verification</code> requirements) See{" "}
            <a href="/reference/entities/products/overview#product-names">
              Product Names
            </a>
            .
          </>
        ),
      },
      {
        name: "subscriptions",
        type: "string[]",
        description: (
          <>
            A list of products that the Entity is subscribed to. See{" "}
            <a href="/reference/entities/subscriptions/overview#subscription-names">
              Subscription Names
            </a>
            .
          </>
        ),
      },
      {
        name: "available_subscriptions",
        type: "string[]",
        description: (
          <>
            A list of products that the Entity can enroll into a subscription
            with. See{" "}
            <a href="/reference/entities/subscriptions/overview#subscription-names">
              Subscription Names
            </a>
            .
          </>
        ),
      },
      {
        name: "restricted_subscriptions",
        type: "string[]",
        description: (
          <>
            A list of products that the Entity can subscribe to but is missing
            some requirements. (e.g. Missing <code>Verification</code> requirements) See{" "}
            <a href="/reference/entities/subscriptions/overview#subscription-names">
              Subscription Names
            </a>
            .
          </>
        ),
      },
      get_common_parameters("Entity").metadata,
      get_common_parameters("Entity").created_at,
      get_common_parameters("Entity").updated_at,
      ]}
    />
  </Tab>

  <Tab title="Corporation">
    <ParamList
      items={[
      get_common_parameters("Entity").id,
      get_common_parameters("Entity").type(["corporation"]),
      {
        name: "corporation",
        type: "object | null",
        description: "Corporation information of the Entity.",
        items: [
          {
            name: "corporation.name",
            type: "string | null",
            description: "The legal name of the corporation Entity.",
          },
          {
            name: "corporation.dba",
            type: "string | null",
            description:
              "DBA (Doing Business As) name of the corporation Entity.",
          },
          {
            name: "corporation.ein",
            type: "string | null",
            description: "The EIN of the corporation Entity.",
          },
          {
            name: "corporation.owners",
            type: "object[]",
            description:
              "The details of the corporation's owners (only include individuals owning 25% or more of the corporation).",
            items: [
              {
                name: "corporation.owners.first_name",
                type: "string | null",
                description: "The legal first name of the corporation owner.",
              },
              {
                name: "corporation.owners.last_name",
                type: "string | null",
                description: "The legal last name of the corporation owner.",
              },
              {
                name: "corporation.owners.phone",
                type: "string | null",
                description:
                  "Mobile phone number of the corporation owner in E.164 format. The number will only be used for KYC / AML verification.",
              },
              {
                name: "corporation.owners.email",
                type: "string | null",
                description:
                  "Email address of the corporation owner. The email will only be used for KYC / AML verification.",
              },
              {
                name: "corporation.owners.dob",
                type: "string | null",
                description:
                  "The corporation owner's date of birth in ISO 8601 format.",
              },
              {
                name: "corporation.owners.address",
                type: "object",
                description: "The corporation owner's address.",
                items: [
                  {
                    name: "corporation.owners.address.line1",
                    type: "string | null",
                    description:
                      "The first line of the corporation owner's address.",
                  },
                  {
                    name: "corporation.owners.address.line2",
                    type: "string | null",
                    description:
                      "The second line of the corporation owner's address.",
                  },
                  {
                    name: "corporation.owners.address.city",
                    type: "string | null",
                    description:
                      "The city of the corporation owner's address.",
                  },
                  {
                    name: "corporation.owners.address.state",
                    type: "string | null",
                    description:
                      "The two-letter abbreviation for the state of the corporation owner's address.",
                  },
                  {
                    name: "corporation.owners.address.zip",
                    type: "string | null",
                    description: "The ZIP code of the corporation owner.",
                  },
                ],
              },
            ],
          },
        ],
      },
      get_common_parameters("Entity").error,
      {
        name: "address",
        type: "object | null",
        description: "The Entity's address.",
        items: [
          {
            name: "address.line1",
            type: "string",
            description: "The first line of the Entity's address.",
          },
          {
            name: "address.line2",
            type: "string",
            description: "The second line of the Entity's address.",
          },
          {
            name: "address.city",
            type: "string",
            description: "The city of the Entity's address.",
          },
          {
            name: "address.state",
            type: "string",
            description:
              "The two-letter abbreviation for the state of the Entity's address.",
          },
          {
            name: "address.zip",
            type: "string",
            description: "The ZIP code of the Entity's address.",
          },
        ],
      },
      get_common_parameters("Entity").status([
        {
          name: "active",
          description:
            "The Entity has passed basic KYB verification.",
        },
        {
          name: "incomplete",
          description:
            "The Entity could not be verified using the information provided. Update the Entity by providing more information to enable capabilities.",
        },
        {
          name: "disabled",
          description: (
            <>
              The Entity has been disabled and no longer has capabilities.
              Entities can transition into the <code>disabled</code> status if
              an Entity revokes authorization for a payment that has already
              been sent.
            </>
          ),
        },
      ]),
      get_common_parameters("Entity").metadata,
      get_common_parameters("Entity").created_at,
      get_common_parameters("Entity").updated_at,
      ]}
    />
  </Tab>
</Tabs>

## Webhook Payload

The [Webhook](/reference/webhooks/overview) payload will contain the following information:

```json
{
  "id": "string",
  "type": "entity.create" | "entity.update",
  "path": "/entities/<ent_id>",
  "event": "<evt_id>"
}
```

<RequestExample>
  ```json Individual
  {
    "id": "ent_BzirqpLEm3BW7",
    "type": "individual",
    "individual": {
      "first_name": "Kevin",
      "last_name": "Doyle",
      "phone": "+15121231113",
      "dob": "1997-03-18",
      "email": "kevin.doyle@gmail.com",
      "ssn_4": "xxxx",
      "ssn": "xxxxxxxxx"
    },
    "error": null,
    "address": {
      "line1": "3300 N Interstate 35",
      "line2": null,
      "city": "Austin",
      "state": "TX",
      "zip": "78705"
    },
    "status": "incomplete",
    "verification": {
      "identity": {
        "verified": false,
        "matched": false,
        "latest_verification_session": null,
        "methods": [
          "element",
          "kba"
        ]
      },
      "phone": {
        "verified": true,
        "latest_verification_session": "evf_P4QXNj93Y9J8L",
        "methods": []
      }
    },
    "connect": null,
    "credit_score": null,
    "products": [
      "identity"
    ],
    "restricted_products": [
      "credit_score",
      "connect",
      "attribute"
    ],
    "subscriptions": [],
    "available_subscriptions": [],
    "restricted_subscriptions": [
      "connect",
      "credit_score"
    ],
    "metadata": null,
    "created_at": "2023-10-24T21:50:53.024Z",
    "updated_at": "2023-10-24T21:50:53.024Z"
  }
  ```

  ```json Corporation
  {
    "id": "ent_A6bmTtFmxQhGQ",
    "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"
          }
        }
      ]
    },
    "error": null,
    "address": {
      "line1": "1600 Amphitheatre Parkway",
      "line2": null,
      "city": "Mountain View",
      "state": "CA",
      "zip": "94043"
    },
    "status": "active",
    "metadata": null,
    "created_at": "2023-10-24T21:26:17.225Z",
    "updated_at": "2023-10-24T21:26:17.225Z"
  }
  ```
</RequestExample>


# List all Products

GET /entities/{ent_id}/products

export const ParamList = ({items, is_child = false}) => {
  return items.map(item => {
    const field_props = {
      id: Math.random().toString(),
      body: item.name,
      name: item.name,
      type: item.type,
      required: item.required
    };
    const enums = item.enums || [];
    const items = item.items || [];
    const has_items = items?.length > 0;
    const has_enums = enums?.length > 0;
    const should_default_open = item.defaultOpen | false;
    const render_child_item = () => {
      const child_props = {
        title: has_enums ? "Possible enum values" : "properties"
      };
      if (should_default_open) child_props.defaultOpen = true;
      const has_inline_enums = has_enums && enums.every(enum_item => typeof enum_item === 'string') && enums.map((enum_item, idx) => {
        const is_last = idx === enums.length - 1;
        const is_2nd_to_last = idx === enums.length - 2;
        return <>
            <code>{enum_item}</code>
            {is_last && ''}
            {is_2nd_to_last && ' or '}
            {!is_last && !is_2nd_to_last && ', '}
          </>;
      });
      const enum_list = has_enums && !has_inline_enums && <Accordion {...child_props}>
          {enums.map(enum_item => <>
              <code>{enum_item.name}</code>
              <br />
              <p>{enum_item.description}</p>
            </>)}
        </Accordion>;
      const item_list = has_items && <Expandable {...child_props}>
          <ParamList items={items || []} is_child />
        </Expandable>;
      return <>
          <p>
            {item.description}
            {has_inline_enums && [has_inline_enums.length > 1 ? ' One of ' : ' Must be ', ...has_inline_enums]}
          </p>

          {enum_list}
          {item_list}
        </>;
    };
    return is_child ? <ResponseField {...field_props}>{render_child_item()}</ResponseField> : <ParamField {...field_props}>{render_child_item()}</ParamField>;
  });
};

Returns a map of Product names to Product objects for an Entity.

## Path Parameters

<ParamList
  items={[
  {
  name: 'ent_id',
  type: 'string',
  required: true,
  description: 'ID of the Entity.',
  },
  ]}
/>

## Returns

Returns a map of Product names to Product objects.

<RequestExample>
  ```bash cURL
  curl "https://production.methodfi.com/entities/ent_TYHMaRJUUeJ7U/products" \
    -H "Method-Version: 2024-04-04" \
    -H "Authorization: Bearer sk_WyZEWVfTcH7GqmPzUPk65Vjc"
  ```

  ```javascript Node.js
  const response = await method
    .entities('ent_TYHMaRJUUeJ7U')
    .products
    .list();
  ```

  ```python Python
  response = method
    .entities('ent_TYHMaRJUUeJ7U')
    .products
    .list()
  ```
</RequestExample>

<ResponseExample>
  ```json THE PRODUCT OBJECT
  {
    "connect": {
      "id": "prd_jPRDcQPMk43Ek",
      "name": "connect",
      "status": "unavailable",
      "status_error": {
          "type": "INVALID_REQUEST",
          "sub_type": "ACCOUNT_CONSENT_UNAVAILABLE",
          "message": "Account consent for your organization is unavailable."
      },
      "latest_request_id": null,
      "is_subscribable": true,
      "created_at": "2024-04-12T00:09:07.521Z",
      "updated_at": "2024-04-12T00:09:07.532Z"
    },
    "credit_score": {
      "id": "prd_jKpF9izhfqL9w",
      "name": "credit_score",
      "status": "available",
      "status_error": null,
      "latest_request_id": null,
      "is_subscribable": true,
      "created_at": "2024-04-12T00:09:07.522Z",
      "updated_at": "2024-04-12T00:09:09.088Z"
    },
    "identity": {
      "id": "prd_tnpbLh8jCMw4X",
      "name": "identity",
      "status": "restricted",
      "status_error": {
          "type": "INVALID_REQUEST",
          "sub_type": "TEAM_CAPABILITY_RESTRICTED",
          "message": "Team access is not available. Reach out to the Method team to learn more."
      },
    "attribute": {
        "id": "prd_LA4EicjTn87L4",
        "name": "attribute",
        "status": "restricted",
        "status_error": {
            "type": "INVALID_REQUEST",
            "sub_type": "PRODUCT_RESTRICTED_CONNECT_REQUIRED",
            "message": "Entity must have a completed Connect record to access this product."
        },
        "latest_request_id": null,
        "is_subscribable": false,
        "created_at": "2024-09-10T02:18:06.405Z",
        "updated_at": "2024-09-10T02:18:06.430Z"
      },
      "latest_request_id": null,
      "is_subscribable": false,
      "created_at": "2024-04-12T00:09:07.523Z",
      "updated_at": "2024-04-12T00:09:07.534Z"
    }
  }
  ```
</ResponseExample>


# The products endpoint



export const get_common_parameters = (resource_name = 'resource') => {
  return {
    id: {
      name: 'id',
      type: "string",
      required: false,
      description: `Unique identifier for the ${resource_name}.`
    },
    entity_id: {
      name: 'entity_id',
      type: 'string',
      required: false,
      description: 'The ID of the associated Entity.'
    },
    account_id: {
      name: 'account_id',
      type: 'string',
      required: false,
      description: 'The ID of the associated Account.'
    },
    error: {
      name: 'error',
      type: 'object | null',
      required: false,
      description: <>
          An object representing an error that occurred while processing
          this {resource_name}. See <a href={`/reference/errors/${resource_name.replace(/^([A-Z])/, function (match) {
        return match.toLowerCase();
      }).replace(/([A-Z])/g, function (match) {
        return "-" + match.toLowerCase();
      })}-errors`}>{resource_name} errors</a>.
        </>
    },
    status_error: {
      name: 'status_error',
      type: 'object | null',
      required: false,
      description: <>
          An object representing an error that occurred while processing
          this {resource_name}. See <a href="/reference/errors/product-errors#status-errors">{resource_name} errors</a>.
        </>
    },
    metadata: {
      name: 'metadata',
      type: 'object | null',
      required: false,
      description: <>
          Additional data provided during creation.
          See <a href="/reference/metadata">metadata</a>
        </>
    },
    created_at: {
      name: 'created_at',
      type: 'string',
      required: false,
      description: `Timestamp of when the ${resource_name} was created.`
    },
    updated_at: {
      name: 'updated_at',
      type: 'string',
      required: false,
      description: `Timestamp of when the ${resource_name} was last updated.`
    },
    status: (enums = []) => ({
      name: 'status',
      type: 'enum',
      required: false,
      description: `Status of the ${resource_name}.`,
      enums
    }),
    type: (enums = []) => ({
      name: 'type',
      type: 'enum',
      required: false,
      description: `The type of ${resource_name}.`,
      enums
    })
  };
};

export const ParamList = ({items, is_child = false}) => {
  return items.map(item => {
    const field_props = {
      id: Math.random().toString(),
      body: item.name,
      name: item.name,
      type: item.type,
      required: item.required
    };
    const enums = item.enums || [];
    const items = item.items || [];
    const has_items = items?.length > 0;
    const has_enums = enums?.length > 0;
    const should_default_open = item.defaultOpen | false;
    const render_child_item = () => {
      const child_props = {
        title: has_enums ? "Possible enum values" : "properties"
      };
      if (should_default_open) child_props.defaultOpen = true;
      const has_inline_enums = has_enums && enums.every(enum_item => typeof enum_item === 'string') && enums.map((enum_item, idx) => {
        const is_last = idx === enums.length - 1;
        const is_2nd_to_last = idx === enums.length - 2;
        return <>
            <code>{enum_item}</code>
            {is_last && ''}
            {is_2nd_to_last && ' or '}
            {!is_last && !is_2nd_to_last && ', '}
          </>;
      });
      const enum_list = has_enums && !has_inline_enums && <Accordion {...child_props}>
          {enums.map(enum_item => <>
              <code>{enum_item.name}</code>
              <br />
              <p>{enum_item.description}</p>
            </>)}
        </Accordion>;
      const item_list = has_items && <Expandable {...child_props}>
          <ParamList items={items || []} is_child />
        </Expandable>;
      return <>
          <p>
            {item.description}
            {has_inline_enums && [has_inline_enums.length > 1 ? ' One of ' : ' Must be ', ...has_inline_enums]}
          </p>

          {enum_list}
          {item_list}
        </>;
    };
    return is_child ? <ResponseField {...field_props}>{render_child_item()}</ResponseField> : <ParamField {...field_props}>{render_child_item()}</ParamField>;
  });
};

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

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

### Product Names

Products that an Entity can have access to:

| Name           | Use-Case                                                             | Resource Doc                                                |
| -------------- | -------------------------------------------------------------------- | ----------------------------------------------------------- |
| `connect`      | On-Demand comprehensive view of an Entity’s outstanding liabilities. | [Connect](/reference/entities/connect/overview)             |
| `credit_score` | On-Demand view of an Entity’s credit score.                          | [Credit Scores](/reference/entities/credit-scores/overview) |
| `identity`     | On-Demand retrieval of the full Identity (PII) for any Entity        | [Identities](/reference/entities/identities/overview)       |
| `attribute`    | On-Demand view of an Entity’s credit health attributes.              | [Attributes](/reference/entities/attributes/overview)       |

## Product Objects

<ParamList
  items={[
  get_common_parameters("Product").id,
  {
    name: "name",
    type: "string",
    required: false,
    description: (
      <>
        The name of the Product. See{" "}
        <a href="/reference/entities/products/overview#product-names">Product Names.</a>
      </>
    ),
  },
  get_common_parameters("Product").status([
    {
      name: "available",
      description: "This Product is available for requests.",
    },
    {
      name: "unavailable",
      description:
        "Product is unavailable or is not in a fixable state for this Entity.",
    },
    {
      name: "restricted",
      description: "This Product is not available to your team at this time. Contact your Method CSM for access.",
    },
  ]),
  get_common_parameters("Product").status_error,
  {
    name: "latest_request_id",
    type: "string | null",
    required: false,
    description: "ID of the most recently created Product resource.",
  },
  {
    name: "is_subscribable",
    type: "boolean",
    required: false,
    description:
      "A field indicating whether a Product supports Subscription enrollment.",
  },
  get_common_parameters("Product").created_at,
  get_common_parameters("Product").updated_at,
  ]}
/>

## Webhook Payload

The [Webhook](/reference/webhooks/overview) payload will contain the following information:

```json
{
  "id": "string",
  "type": "product.create" | "product.update",
  "path": "/entities/<ent_id>/products/<prd_id>",
}
```

<RequestExample>
  ```json THE PRODUCT OBJECT
  {
    "connect": {
      "id": "prd_jPRDcQPMk43Ek",
      "name": "connect",
      "status": "unavailable",
      "status_error": {
          "type": "INVALID_REQUEST",
          "sub_type": "ACCOUNT_CONSENT_UNAVAILABLE",
          "message": "Account consent for your organization is unavailable."
      },
      "latest_request_id": null,
      "is_subscribable": true,
      "created_at": "2024-04-12T00:09:07.521Z",
      "updated_at": "2024-04-12T00:09:07.532Z"
    },
    "credit_score": {
      "id": "prd_jKpF9izhfqL9w",
      "name": "credit_score",
      "status": "available",
      "status_error": null,
      "latest_request_id": null,
      "is_subscribable": true,
      "created_at": "2024-04-12T00:09:07.522Z",
      "updated_at": "2024-04-12T00:09:09.088Z"
    },
    "identity": {
      "id": "prd_tnpbLh8jCMw4X",
      "name": "identity",
      "status": "restricted",
      "status_error": {
          "type": "INVALID_REQUEST",
          "sub_type": "TEAM_CAPABILITY_RESTRICTED",
          "message": "Team access is not available. Reach out to the Method team to learn more."
      },
      "latest_request_id": null,
      "is_subscribable": false,
      "created_at": "2024-04-12T00:09:07.523Z",
      "updated_at": "2024-04-12T00:09:07.534Z"
    }
  }
  ```
</RequestExample>


# Retrieve a Product

GET /entities/{ent_id}/products/{prd_id}

export const ParamList = ({items, is_child = false}) => {
  return items.map(item => {
    const field_props = {
      id: Math.random().toString(),
      body: item.name,
      name: item.name,
      type: item.type,
      required: item.required
    };
    const enums = item.enums || [];
    const items = item.items || [];
    const has_items = items?.length > 0;
    const has_enums = enums?.length > 0;
    const should_default_open = item.defaultOpen | false;
    const render_child_item = () => {
      const child_props = {
        title: has_enums ? "Possible enum values" : "properties"
      };
      if (should_default_open) child_props.defaultOpen = true;
      const has_inline_enums = has_enums && enums.every(enum_item => typeof enum_item === 'string') && enums.map((enum_item, idx) => {
        const is_last = idx === enums.length - 1;
        const is_2nd_to_last = idx === enums.length - 2;
        return <>
            <code>{enum_item}</code>
            {is_last && ''}
            {is_2nd_to_last && ' or '}
            {!is_last && !is_2nd_to_last && ', '}
          </>;
      });
      const enum_list = has_enums && !has_inline_enums && <Accordion {...child_props}>
          {enums.map(enum_item => <>
              <code>{enum_item.name}</code>
              <br />
              <p>{enum_item.description}</p>
            </>)}
        </Accordion>;
      const item_list = has_items && <Expandable {...child_props}>
          <ParamList items={items || []} is_child />
        </Expandable>;
      return <>
          <p>
            {item.description}
            {has_inline_enums && [has_inline_enums.length > 1 ? ' One of ' : ' Must be ', ...has_inline_enums]}
          </p>

          {enum_list}
          {item_list}
        </>;
    };
    return is_child ? <ResponseField {...field_props}>{render_child_item()}</ResponseField> : <ParamField {...field_props}>{render_child_item()}</ParamField>;
  });
};

Retrieves a Product record for an Entity.

## Path Parameters

<ParamList
  items={[
  {
  name: 'ent_id',
  type: 'string',
  required: true,
  description: 'ID of the Entity.',
  },
  {
  name: 'prd_id',
  type: 'string',
  required: true,
  description: 'ID of the Product.',
  },
  ]}
/>

## Returns

Returns a Product object.

<RequestExample>
  ```bash cURL
  curl "https://production.methodfi.com/entities/ent_TYHMaRJUUeJ7U/products/prd_jPRDcQPMk43Ek" \
    -H "Method-Version: 2024-04-04" \
    -H "Authorization: Bearer sk_WyZEWVfTcH7GqmPzUPk65Vjc"
  ```

  ```javascript Node.js
  const response = await method
    .entities("ent_TYHMaRJUUeJ7U")
    .products
    .retrieve("prd_jPRDcQPMk43Ek");
  ```

  ```python Python
  response = method
    .entities('ent_TYHMaRJUUeJ7U')
    .products
    .retrieve('prd_jPRDcQPMk43Ek')
  ```
</RequestExample>

<ResponseExample>
  ```json THE PRODUCT OBJECT
  {
    "id": "prd_jKpF9izhfqL9w",
    "name": "credit_score",
    "status": "available",
    "status_error": null,
    "latest_request_id": null,
    "is_subscribable": true,
    "created_at": "2024-04-12T00:09:07.522Z",
    "updated_at": "2024-04-12T00:09:09.088Z"
  }
  ```
</ResponseExample>


# Retrieve an Entity

GET https://production.methodfi.com/entities/{ent_id}

export const ExpandableFieldsQueryParams = (resource_type = 'all') => {
  const entity = [{
    name: 'connect',
    description: <>This is an <a href="/reference/entities/overview">Entity</a> property, and refers to the <a href="/reference/entities/connect/overview#connect-objects">Connect Object</a>.</>
  }, {
    name: 'credit_score',
    description: <>This is an <a href="/reference/entities/overview">Entity</a> property, and refers to the <a href="/reference/entities/credit-scores/overview#creditscore-objects">CreditScore Object</a>.</>
  }, {
    name: 'attribute',
    description: <>This is an <a href="/reference/entities/overview">Entity</a> property, and refers to the <a href="/reference/entities/attributes/overview#attribute-objects">Attribute Object</a>.</>
  }, {
    name: 'identity_latest_verification_session',
    description: <>This is an <a href="/reference/entities/overview">Entity</a> property, and refers to the <a href="/reference/entities/verification-sessions/overview#entity-verification-session-objects">EntityVerificationSession Object</a>.</>
  }, {
    name: 'phone_latest_verification_session',
    description: <>This is an <a href="/reference/entities/overview">Entity</a> property, and refers to the <a href="/reference/entities/verification-sessions/overview#entity-verification-session-objects">EntityVerificationSession Object</a>.</>
  }];
  const account = [{
    name: 'sensitive',
    description: <>This is an <a href="/reference/accounts/overview">Account</a> property, and refers to the <a href="/reference/accounts/sensitive/overview#sensitive-objects">Sensitive Object</a>.</>
  }, {
    name: 'balance',
    description: <>This is an <a href="/reference/accounts/overview">Account</a> property, and refers to the <a href="/reference/accounts/balances/overview#balances-objects">Balance Object</a>.</>
  }, {
    name: 'card_brand',
    description: <>This is an <a href="/reference/accounts/overview">Account</a> property, and refers to the <a href="/reference/accounts/card-brands/overview#cardbrand-objects">CardBrand Object</a>.</>
  }, {
    name: 'payoff',
    description: <>This is an <a href="/reference/accounts/overview">Account</a> property, and refers to the <a href="/reference/accounts/payoffs/overview#payoff-objects">Payoff Object</a>.</>
  }, {
    name: 'transactions',
    description: <>This is an <a href="/reference/accounts/overview">Account</a> property, and refers to the <a href="/reference/accounts/transactions/overview#transaction-objects">Transaction Object</a>.</>
  }, {
    name: 'update',
    description: <>This is an <a href="/reference/accounts/overview">Account</a> property, and refers to the <a href="/reference/accounts/updates/overview#update-objects">Update Object</a>.</>
  }, {
    name: 'latest_verification_session',
    description: <>This is an <a href="/reference/accounts/overview">Account</a> property, and refers to the <a href="/reference/accounts/verification-sessions/overview#accountverificationsession-objects">AccountVerificationSession Object</a>.</>
  }];
  const ExpandableFieldsByResourceType = {
    entity,
    account,
    all: Array.from(new Set([...entity, ...account]))
  };
  return {
    name: "expand",
    type: "enum[]",
    description: <>
        Attributes that can be expanded into an object to
        provide additional information.
      </>,
    enums: [...ExpandableFieldsByResourceType[resource_type].map(expandable_field => ({
      ...expandable_field
    }))]
  };
};

export const ParamList = ({items, is_child = false}) => {
  return items.map(item => {
    const field_props = {
      id: Math.random().toString(),
      body: item.name,
      name: item.name,
      type: item.type,
      required: item.required
    };
    const enums = item.enums || [];
    const items = item.items || [];
    const has_items = items?.length > 0;
    const has_enums = enums?.length > 0;
    const should_default_open = item.defaultOpen | false;
    const render_child_item = () => {
      const child_props = {
        title: has_enums ? "Possible enum values" : "properties"
      };
      if (should_default_open) child_props.defaultOpen = true;
      const has_inline_enums = has_enums && enums.every(enum_item => typeof enum_item === 'string') && enums.map((enum_item, idx) => {
        const is_last = idx === enums.length - 1;
        const is_2nd_to_last = idx === enums.length - 2;
        return <>
            <code>{enum_item}</code>
            {is_last && ''}
            {is_2nd_to_last && ' or '}
            {!is_last && !is_2nd_to_last && ', '}
          </>;
      });
      const enum_list = has_enums && !has_inline_enums && <Accordion {...child_props}>
          {enums.map(enum_item => <>
              <code>{enum_item.name}</code>
              <br />
              <p>{enum_item.description}</p>
            </>)}
        </Accordion>;
      const item_list = has_items && <Expandable {...child_props}>
          <ParamList items={items || []} is_child />
        </Expandable>;
      return <>
          <p>
            {item.description}
            {has_inline_enums && [has_inline_enums.length > 1 ? ' One of ' : ' Must be ', ...has_inline_enums]}
          </p>

          {enum_list}
          {item_list}
        </>;
    };
    return is_child ? <ResponseField {...field_props}>{render_child_item()}</ResponseField> : <ParamField {...field_props}>{render_child_item()}</ParamField>;
  });
};

Returns the Entity associated with the ID.

## Path Parameters

<ParamList
  items={[
  {
    name: "ent_id",
    type: "string",
    description: `The ID of the Entity.`,
  },
  ]}
/>

## Query Parameters

<ParamList
  items={[
  ExpandableFieldsQueryParams("entity"),
  ]}
/>

## Returns

Returns the Entity associated with the ID.

<RequestExample>
  ```bash cURL
  curl https://production.methodfi.com/entities/ent_au22b1fbFJbp8 \
    -H "Method-Version: 2024-04-04" \
    -H "Authorization: Bearer sk_WyZEWVfTcH7GqmPzUPk65Vjc"
  ```

  ```javascript Node.js
  const entity = await method.entities.retrieve("ent_au22b1fbFJbp8");
  ```

  ```python Python
  entity = method.entities.retrieve('ent_au22b1fbFJbp8')
  ```
</RequestExample>

<ResponseExample>
  ```json
  {
    "id": "ent_au22b1fbFJbp8",
    "type": "individual",
    "individual": {
        "first_name": "Kevin",
        "last_name": "Doyle",
        "phone": "+15121231111",
        "dob": "1997-03-18",
        "email": "kevin.doyle@gmail.com",
        "ssn_4": "xxxx",
        "ssn": null,
    },
    "error": null,
    "address": {
        "line1": "3300 N Interstate 35",
        "line2": null,
        "city": "Austin",
        "state": "TX",
        "zip": "78705"
    },
    "status": "active",
    "verification": {
      "identity": {
        "verified": true,
        "matched": true,
        "latest_verification_session": "evf_mQ6yr6VVJLNEb",
        "methods": []
      },
      "phone": {
        "verified": true,
        "latest_verification_session": "evf_P4QXNj93Y9J8L",
        "methods": []
      }
    },
    "connect": null,
    "credit_score": null,
    "products": [
      "connect",
      "credit_score"
    ],
    "restricted_products": [
      "identity", 
      "attribute"
    ],
    "subscriptions": [],
    "available_subscriptions": [
      "connect",
      "credit_score"
    ],
    "restricted_subscriptions": [],
    "metadata": null,
    "created_at": "2023-10-23T05:46:14.550Z",
    "updated_at": "2023-10-23T05:46:14.550Z"
  }
  ```
</ResponseExample>


# Create a Subscription

POST /entities/{ent_id}/subscriptions

export const ParamList = ({items, is_child = false}) => {
  return items.map(item => {
    const field_props = {
      id: Math.random().toString(),
      body: item.name,
      name: item.name,
      type: item.type,
      required: item.required
    };
    const enums = item.enums || [];
    const items = item.items || [];
    const has_items = items?.length > 0;
    const has_enums = enums?.length > 0;
    const should_default_open = item.defaultOpen | false;
    const render_child_item = () => {
      const child_props = {
        title: has_enums ? "Possible enum values" : "properties"
      };
      if (should_default_open) child_props.defaultOpen = true;
      const has_inline_enums = has_enums && enums.every(enum_item => typeof enum_item === 'string') && enums.map((enum_item, idx) => {
        const is_last = idx === enums.length - 1;
        const is_2nd_to_last = idx === enums.length - 2;
        return <>
            <code>{enum_item}</code>
            {is_last && ''}
            {is_2nd_to_last && ' or '}
            {!is_last && !is_2nd_to_last && ', '}
          </>;
      });
      const enum_list = has_enums && !has_inline_enums && <Accordion {...child_props}>
          {enums.map(enum_item => <>
              <code>{enum_item.name}</code>
              <br />
              <p>{enum_item.description}</p>
            </>)}
        </Accordion>;
      const item_list = has_items && <Expandable {...child_props}>
          <ParamList items={items || []} is_child />
        </Expandable>;
      return <>
          <p>
            {item.description}
            {has_inline_enums && [has_inline_enums.length > 1 ? ' One of ' : ' Must be ', ...has_inline_enums]}
          </p>

          {enum_list}
          {item_list}
        </>;
    };
    return is_child ? <ResponseField {...field_props}>{render_child_item()}</ResponseField> : <ParamField {...field_props}>{render_child_item()}</ParamField>;
  });
};

Enrolls an Entity to a Subscription. Once
enrolled, the Subscription name and details will be present
on the response object.

## Path Parameters

<ParamList
  items={[
  {
    name: "ent_id",
    type: "string",
    required: true,
    description: "ID of the Entity.",
  },
  ]}
/>

## Body

<ParamList
  items={[
  {
    name: "enroll",
    type: "enum",
    required: true,
    description: (
      <>
        A {" "}
        <a href="/reference/entities/subscriptions/overview#subscription-names">
          Subscription Names.
        </a>
      </>
    ),
  },
  ]}
/>

## Returns

Returns a Subscription object.

<RequestExample>
  ```bash cURL
  curl https://production.methodfi.com/entities/ent_TYHMaRJUUeJ7U/subscriptions \
    -X POST \
    -H "Method-Version: 2024-04-04" \
    -H "Authorization: Bearer sk_WyZEWVfTcH7GqmPzUPk65Vjc"
    -H "Content-Type: application/json" \
    -d '{
      "enroll": "credit_score"
    }'
  ```

  ```javascript Node.js
  const response = await method
    .entities("ent_TYHMaRJUUeJ7U")
    .subscriptions
    .create('credit_score');
  ```

  ```python Python
  response = method
    .entities('ent_TYHMaRJUUeJ7U')
    .subscriptions
    .create('credit_score')
  ```
</RequestExample>

<ResponseExample>
  ```json
  {
    "id": "sub_c3a7hVjHCJzF3",
    "name": "credit_score",
    "status": "active",
    "latest_request_id": null,
    "created_at": "2024-04-18T18:48:33.875Z",
    "updated_at": "2024-04-18T18:48:33.875Z"
  }
  ```
</ResponseExample>


# Delete a Subscription

DELETE /entities/{ent_id}/subscriptions/{sub_id}

export const ParamList = ({items, is_child = false}) => {
  return items.map(item => {
    const field_props = {
      id: Math.random().toString(),
      body: item.name,
      name: item.name,
      type: item.type,
      required: item.required
    };
    const enums = item.enums || [];
    const items = item.items || [];
    const has_items = items?.length > 0;
    const has_enums = enums?.length > 0;
    const should_default_open = item.defaultOpen | false;
    const render_child_item = () => {
      const child_props = {
        title: has_enums ? "Possible enum values" : "properties"
      };
      if (should_default_open) child_props.defaultOpen = true;
      const has_inline_enums = has_enums && enums.every(enum_item => typeof enum_item === 'string') && enums.map((enum_item, idx) => {
        const is_last = idx === enums.length - 1;
        const is_2nd_to_last = idx === enums.length - 2;
        return <>
            <code>{enum_item}</code>
            {is_last && ''}
            {is_2nd_to_last && ' or '}
            {!is_last && !is_2nd_to_last && ', '}
          </>;
      });
      const enum_list = has_enums && !has_inline_enums && <Accordion {...child_props}>
          {enums.map(enum_item => <>
              <code>{enum_item.name}</code>
              <br />
              <p>{enum_item.description}</p>
            </>)}
        </Accordion>;
      const item_list = has_items && <Expandable {...child_props}>
          <ParamList items={items || []} is_child />
        </Expandable>;
      return <>
          <p>
            {item.description}
            {has_inline_enums && [has_inline_enums.length > 1 ? ' One of ' : ' Must be ', ...has_inline_enums]}
          </p>

          {enum_list}
          {item_list}
        </>;
    };
    return is_child ? <ResponseField {...field_props}>{render_child_item()}</ResponseField> : <ParamField {...field_props}>{render_child_item()}</ParamField>;
  });
};

Deleting a Subscription means to unsubscribe or unenroll an Entity from automatically
receiving new Product resources.

## Path Parameters

<ParamList
  items={[
  {
  name: 'ent_id',
  type: 'string',
  required: true,
  description: 'ID of the Entity.',
  },
  {
  name: 'sub_id',
  type: 'string',
  required: true,
  description: 'ID of the Subscription.',
  }
  ]}
/>

## Returns

Returns a Subscription object.

<RequestExample>
  ```bash cURL
  curl https://production.methodfi.com/entities/ent_TYHMaRJUUeJ7U/subscriptions/sub_6f7XtMLymQx3f \
    -X DELETE \
    -H "Method-Version: 2024-04-04" \
    -H "Authorization: Bearer sk_WyZEWVfTcH7GqmPzUPk65Vjc"
  ```

  ```javascript Node.js
  const response = await method
    .entities('ent_TYHMaRJUUeJ7U')
    .subscriptions
    .delete('sub_6f7XtMLymQx3f');
  ```

  ```python Python
  response = method
    .entities('ent_TYHMaRJUUeJ7U')
    .subscriptions
    .delete('sub_6f7XtMLymQx3f')
  ```
</RequestExample>

<ResponseExample>
  ```json
  {
    "id": "sub_6f7XtMLymQx3f",
    "name": "credit_score",
    "status": "inactive",
    "latest_request_id": "crs_pn4ca33GXFaCE",
    "created_at": "2024-04-12T00:21:58.765Z",
    "updated_at": "2024-04-12T00:21:58.765Z"
  }
  ```
</ResponseExample>


# List all Subscriptions

GET /entities/{ent_id}/subscriptions

export const ParamList = ({items, is_child = false}) => {
  return items.map(item => {
    const field_props = {
      id: Math.random().toString(),
      body: item.name,
      name: item.name,
      type: item.type,
      required: item.required
    };
    const enums = item.enums || [];
    const items = item.items || [];
    const has_items = items?.length > 0;
    const has_enums = enums?.length > 0;
    const should_default_open = item.defaultOpen | false;
    const render_child_item = () => {
      const child_props = {
        title: has_enums ? "Possible enum values" : "properties"
      };
      if (should_default_open) child_props.defaultOpen = true;
      const has_inline_enums = has_enums && enums.every(enum_item => typeof enum_item === 'string') && enums.map((enum_item, idx) => {
        const is_last = idx === enums.length - 1;
        const is_2nd_to_last = idx === enums.length - 2;
        return <>
            <code>{enum_item}</code>
            {is_last && ''}
            {is_2nd_to_last && ' or '}
            {!is_last && !is_2nd_to_last && ', '}
          </>;
      });
      const enum_list = has_enums && !has_inline_enums && <Accordion {...child_props}>
          {enums.map(enum_item => <>
              <code>{enum_item.name}</code>
              <br />
              <p>{enum_item.description}</p>
            </>)}
        </Accordion>;
      const item_list = has_items && <Expandable {...child_props}>
          <ParamList items={items || []} is_child />
        </Expandable>;
      return <>
          <p>
            {item.description}
            {has_inline_enums && [has_inline_enums.length > 1 ? ' One of ' : ' Must be ', ...has_inline_enums]}
          </p>

          {enum_list}
          {item_list}
        </>;
    };
    return is_child ? <ResponseField {...field_props}>{render_child_item()}</ResponseField> : <ParamField {...field_props}>{render_child_item()}</ParamField>;
  });
};

Returns a map of Subscriptions names to Subscription objects associated with an Entity, or an empty array if none have been created.

## Path Parameters

<ParamList
  items={[
  {
  name: 'ent_id',
  type: 'string',
  required: true,
  description: 'ID of the Entity.',
  }
  ]}
/>

## Returns

Returns a map of Subscription names to Subscription objects.

<RequestExample>
  ```bash cURL
  curl "https://production.methodfi.com/entities/ent_TYHMaRJUUeJ7U/subscriptions" \
    -H "Method-Version: 2024-04-04" \
    -H "Authorization: Bearer sk_WyZEWVfTcH7GqmPzUPk65Vjc"
  ```

  ```javascript Node.js
  const response = await method
    .entities('ent_TYHMaRJUUeJ7U')
    .subscriptions
    .list();
  ```

  ```python Python
  response = method
    .entities('ent_TYHMaRJUUeJ7U')
    .subscriptions
    .list()
  ```
</RequestExample>

<ResponseExample>
  ```json
  {
    "credit_score": {
      "id": "sub_c3a7hVjHCJzF3",
      "name": "credit_score",
      "status": "active",
      "latest_request_id": null,
      "created_at": "2024-04-12T00:21:58.737Z",
      "updated_at": "2024-04-12T00:21:58.737Z"
    },
    "connect": {
      "id": "sub_6f7XtMLymQx3f",
      "name": "connect",
      "status": "active",
      "latest_request_id": null,
      "created_at": "2024-04-12T00:22:54.921Z",
      "updated_at": "2024-04-12T00:22:54.921Z"
    }
  }
  ```
</ResponseExample>


# The subscriptions endpoint



export const get_common_parameters = (resource_name = 'resource') => {
  return {
    id: {
      name: 'id',
      type: "string",
      required: false,
      description: `Unique identifier for the ${resource_name}.`
    },
    entity_id: {
      name: 'entity_id',
      type: 'string',
      required: false,
      description: 'The ID of the associated Entity.'
    },
    account_id: {
      name: 'account_id',
      type: 'string',
      required: false,
      description: 'The ID of the associated Account.'
    },
    error: {
      name: 'error',
      type: 'object | null',
      required: false,
      description: <>
          An object representing an error that occurred while processing
          this {resource_name}. See <a href={`/reference/errors/${resource_name.replace(/^([A-Z])/, function (match) {
        return match.toLowerCase();
      }).replace(/([A-Z])/g, function (match) {
        return "-" + match.toLowerCase();
      })}-errors`}>{resource_name} errors</a>.
        </>
    },
    status_error: {
      name: 'status_error',
      type: 'object | null',
      required: false,
      description: <>
          An object representing an error that occurred while processing
          this {resource_name}. See <a href="/reference/errors/product-errors#status-errors">{resource_name} errors</a>.
        </>
    },
    metadata: {
      name: 'metadata',
      type: 'object | null',
      required: false,
      description: <>
          Additional data provided during creation.
          See <a href="/reference/metadata">metadata</a>
        </>
    },
    created_at: {
      name: 'created_at',
      type: 'string',
      required: false,
      description: `Timestamp of when the ${resource_name} was created.`
    },
    updated_at: {
      name: 'updated_at',
      type: 'string',
      required: false,
      description: `Timestamp of when the ${resource_name} was last updated.`
    },
    status: (enums = []) => ({
      name: 'status',
      type: 'enum',
      required: false,
      description: `Status of the ${resource_name}.`,
      enums
    }),
    type: (enums = []) => ({
      name: 'type',
      type: 'enum',
      required: false,
      description: `The type of ${resource_name}.`,
      enums
    })
  };
};

export const ParamList = ({items, is_child = false}) => {
  return items.map(item => {
    const field_props = {
      id: Math.random().toString(),
      body: item.name,
      name: item.name,
      type: item.type,
      required: item.required
    };
    const enums = item.enums || [];
    const items = item.items || [];
    const has_items = items?.length > 0;
    const has_enums = enums?.length > 0;
    const should_default_open = item.defaultOpen | false;
    const render_child_item = () => {
      const child_props = {
        title: has_enums ? "Possible enum values" : "properties"
      };
      if (should_default_open) child_props.defaultOpen = true;
      const has_inline_enums = has_enums && enums.every(enum_item => typeof enum_item === 'string') && enums.map((enum_item, idx) => {
        const is_last = idx === enums.length - 1;
        const is_2nd_to_last = idx === enums.length - 2;
        return <>
            <code>{enum_item}</code>
            {is_last && ''}
            {is_2nd_to_last && ' or '}
            {!is_last && !is_2nd_to_last && ', '}
          </>;
      });
      const enum_list = has_enums && !has_inline_enums && <Accordion {...child_props}>
          {enums.map(enum_item => <>
              <code>{enum_item.name}</code>
              <br />
              <p>{enum_item.description}</p>
            </>)}
        </Accordion>;
      const item_list = has_items && <Expandable {...child_props}>
          <ParamList items={items || []} is_child />
        </Expandable>;
      return <>
          <p>
            {item.description}
            {has_inline_enums && [has_inline_enums.length > 1 ? ' One of ' : ' Must be ', ...has_inline_enums]}
          </p>

          {enum_list}
          {item_list}
        </>;
    };
    return is_child ? <ResponseField {...field_props}>{render_child_item()}</ResponseField> : <ParamField {...field_props}>{render_child_item()}</ParamField>;
  });
};

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)

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

### Subscription Names

Subscriptions that an Entity can be enrolled in:

| Name           | Use-Case                                                                                                            | Resource Doc                                                |
| -------------- | ------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------- |
| `connect`      | Comprehensive view of an Entity’s outstanding liabilities and continuous near real-time updates on new liabilities. | [Connect](/reference/entities/connect/overview)             |
| `credit_score` | Continuous near real-time updates on an Entity’s credit score.                                                      | [Credit Scores](/reference/entities/credit-scores/overview) |

## Subscriptions Objects

<ParamList
  items={[
  get_common_parameters('Subscription').id,
  {
  name: 'name',
  type: 'string',
  required: false,
  description: (
    <>
      The name of the Subscription. See <a href="/reference/entities/subscriptions/overview#subscription-names">Subscription Names.</a>
    </>
  ),
  },
  get_common_parameters('Subscription').status([
  {
    name: 'active',
    description: 'The associated Entity is currently enrolled in this Subscription.',
  },
  ]),
  {
  name: 'latest_request_id',
  type: 'string | null',
  required: false,
  description: 'ID of the most recently created Product resource under this Subscription.',
  },
  (get_common_parameters('Subscription').created_at),
  (get_common_parameters('Subscription').updated_at),
  ]}
/>

## Webhook Payload

The [Webhook](/reference/webhooks/overview) payload will contain the following information:

```json
{
  "id": "string",
  "type": "subscription.create" | "subscription.update",
  "path": "/entities/<ent_id>/subscriptions/<sub_id>",
}
```

<RequestExample>
  ```json THE SUBSCRIPTION OBJECT
  {
    "credit_score": {
      "id": "sub_6f7XtMLymQx3f",
      "name": "credit_score",
      "status": "active",
      "latest_request_id": "crs_pn4ca33GXFaCE",
      "created_at": "2024-04-12T00:21:58.765Z",
      "updated_at": "2024-04-12T00:21:58.765Z"
    }
  }
  ```
</RequestExample>


# Retrieve a Subscription

GET /entities/{ent_id}/subscriptions/{sub_id}

export const ParamList = ({items, is_child = false}) => {
  return items.map(item => {
    const field_props = {
      id: Math.random().toString(),
      body: item.name,
      name: item.name,
      type: item.type,
      required: item.required
    };
    const enums = item.enums || [];
    const items = item.items || [];
    const has_items = items?.length > 0;
    const has_enums = enums?.length > 0;
    const should_default_open = item.defaultOpen | false;
    const render_child_item = () => {
      const child_props = {
        title: has_enums ? "Possible enum values" : "properties"
      };
      if (should_default_open) child_props.defaultOpen = true;
      const has_inline_enums = has_enums && enums.every(enum_item => typeof enum_item === 'string') && enums.map((enum_item, idx) => {
        const is_last = idx === enums.length - 1;
        const is_2nd_to_last = idx === enums.length - 2;
        return <>
            <code>{enum_item}</code>
            {is_last && ''}
            {is_2nd_to_last && ' or '}
            {!is_last && !is_2nd_to_last && ', '}
          </>;
      });
      const enum_list = has_enums && !has_inline_enums && <Accordion {...child_props}>
          {enums.map(enum_item => <>
              <code>{enum_item.name}</code>
              <br />
              <p>{enum_item.description}</p>
            </>)}
        </Accordion>;
      const item_list = has_items && <Expandable {...child_props}>
          <ParamList items={items || []} is_child />
        </Expandable>;
      return <>
          <p>
            {item.description}
            {has_inline_enums && [has_inline_enums.length > 1 ? ' One of ' : ' Must be ', ...has_inline_enums]}
          </p>

          {enum_list}
          {item_list}
        </>;
    };
    return is_child ? <ResponseField {...field_props}>{render_child_item()}</ResponseField> : <ParamField {...field_props}>{render_child_item()}</ParamField>;
  });
};

Retrieves a Subscription record for an Entity.

## Path Parameters

<ParamList
  items={[
  {
  name: 'ent_id',
  type: 'string',
  required: true,
  description: 'ID of the Entity.',
  },
  {
  name: 'sub_id',
  type: 'string',
  required: true,
  description: 'ID of the Subscription.',
  }
  ]}
/>

## Returns

Returns a Subscription object.

<RequestExample>
  ```bash cURL
  curl "https://production.methodfi.com/entities/ent_TYHMaRJUUeJ7U/subscriptions/sub_6f7XtMLymQx3f" \
    -H "Method-Version: 2024-04-04" \
    -H "Authorization: Bearer sk_WyZEWVfTcH7GqmPzUPk65Vjc"
  ```

  ```javascript Node.js
  const response = await method
    .entities("ent_TYHMaRJUUeJ7U")
    .subscriptions
    .retrieve("sub_6f7XtMLymQx3f");
  ```

  ```python Python
  response = method
    .entities('ent_TYHMaRJUUeJ7U')
    .subscriptions
    .retrieve('sub_6f7XtMLymQx3f')
  ```
</RequestExample>

<ResponseExample>
  ```json
  {
    "id": "sub_6f7XtMLymQx3f",
    "name": "credit_score",
    "status": "active",
    "latest_request_id": null,
    "created_at": "2024-04-12T00:21:58.737Z",
    "updated_at": "2024-04-12T00:21:58.737Z"
  }
  ```
</ResponseExample>


# Update an Entity

PUT https://production.methodfi.com/entities/{ent_id}

export const ParamList = ({items, is_child = false}) => {
  return items.map(item => {
    const field_props = {
      id: Math.random().toString(),
      body: item.name,
      name: item.name,
      type: item.type,
      required: item.required
    };
    const enums = item.enums || [];
    const items = item.items || [];
    const has_items = items?.length > 0;
    const has_enums = enums?.length > 0;
    const should_default_open = item.defaultOpen | false;
    const render_child_item = () => {
      const child_props = {
        title: has_enums ? "Possible enum values" : "properties"
      };
      if (should_default_open) child_props.defaultOpen = true;
      const has_inline_enums = has_enums && enums.every(enum_item => typeof enum_item === 'string') && enums.map((enum_item, idx) => {
        const is_last = idx === enums.length - 1;
        const is_2nd_to_last = idx === enums.length - 2;
        return <>
            <code>{enum_item}</code>
            {is_last && ''}
            {is_2nd_to_last && ' or '}
            {!is_last && !is_2nd_to_last && ', '}
          </>;
      });
      const enum_list = has_enums && !has_inline_enums && <Accordion {...child_props}>
          {enums.map(enum_item => <>
              <code>{enum_item.name}</code>
              <br />
              <p>{enum_item.description}</p>
            </>)}
        </Accordion>;
      const item_list = has_items && <Expandable {...child_props}>
          <ParamList items={items || []} is_child />
        </Expandable>;
      return <>
          <p>
            {item.description}
            {has_inline_enums && [has_inline_enums.length > 1 ? ' One of ' : ' Must be ', ...has_inline_enums]}
          </p>

          {enum_list}
          {item_list}
        </>;
    };
    return is_child ? <ResponseField {...field_props}>{render_child_item()}</ResponseField> : <ParamField {...field_props}>{render_child_item()}</ParamField>;
  });
};

Updates an Entity with the parameters sent.

<Warning>
  Once an Entity's property has been set, that property can no longer be
  updated.
</Warning>

## Path Parameters

<ParamList
  items={[
  {
    name: "ent_id",
    type: "string",
    description: `The ID of the Entity.`,
  },
  ]}
/>

## Body

<Tabs>
  <Tab title="Individual">
    <ParamField body="individual" type="object" optional>
      Individual information of the Entity. See [Individual Entity.](/reference/entities/overview#entity-objects)
    </ParamField>
  </Tab>

  <Tab title="Corporation">
    <ParamField body="corporation" type="object" optional>
      Corporation information of the Entity. See [Corporation Entity.](/reference/entities/overview#entity-objects)
    </ParamField>
  </Tab>
</Tabs>

<ParamField body="address" type="object" optional>
  The Entity's address. See [Entity address.](/reference/entities/overview#entity-objects)
</ParamField>

## Returns

Returns the entity with the updated fields.

<RequestExample>
  ```bash cURL
  curl https://production.methodfi.com/entities/ent_au22b1fbFJbp8 \
    -X PUT \
    -H "Method-Version: 2024-04-04" \
    -H "Authorization: Bearer sk_WyZEWVfTcH7GqmPzUPk65Vjc" \
    -H "Content-Type: application/json" \
    -d '{
      "individual": {
        "first_name": "Kevin",
        "last_name": "Doyle",
        "email": "kevin.doyle@gmail.com",
        "dob": "1997-03-18"
      }
  }'
  ```

  ```javascript Node.js
  const entity = await method.entities.update("ent_au22b1fbFJbp8", {
    individual: {
      first_name: "Kevin",
      last_name: "Doyle",
      email: "kevin.doyle@gmail.com",
      dob: "1997-03-18",
    },
  });
  ```

  ```python Python
  entity = method.entities.update('ent_au22b1fbFJbp8', {
    'individual': {
      'first_name': 'Kevin',
      'last_name': 'Doyle',
      'email': 'kevin.doyle@gmail.com',
      'dob': '1997-03-18',
    }
  })
  ```
</RequestExample>

<ResponseExample>
  ```json
  {
    "id": "ent_au22b1fbFJbp8",
    "type": "individual",
    "individual": {
      "first_name": "Kevin",
      "last_name": "Doyle",
      "phone": "+15121231111",
      "dob": "1997-03-18",
      "email": "kevin.doyle@gmail.com",
      "ssn_4": null,
      "ssn": null
    },
    "error": null,
    "address": {
      "line1": "3300 N Interstate 35",
      "line2": null,
      "city": "Austin",
      "state": "TX",
      "zip": "78705"
    },
    "status": "active",
    "verification": {
      "identity": {
        "verified": true,
        "matched": true,
        "latest_verification_session": "evf_mQ6yr6VVJLNEb",
        "methods": []
      },
      "phone": {
        "verified": true,
        "latest_verification_session": "evf_P4QXNj93Y9J8L",
        "methods": []
      }
    },
    "connect": null,
    "credit_score": null,
    "products": [
      "connect",
      "credit_score"
    ],
    "restricted_products": [
      "identity",
      "attribute"
    ],
    "subscriptions": [],
    "available_subscriptions": [
      "connect",
      "credit_score"
    ],
    "restricted_subscriptions": [],
    "metadata": null,
    "created_at": "2023-10-23T05:46:14.550Z",
    "updated_at": "2023-10-23T05:46:14.550Z"
  }
  ```
</ResponseExample>


# Create a BYO KYC Verification

POST /entities/{ent_id}/verification_sessions

export const entity_verification_session_name = "EntityVerificationSession";

export const ParamList = ({items, is_child = false}) => {
  return items.map(item => {
    const field_props = {
      id: Math.random().toString(),
      body: item.name,
      name: item.name,
      type: item.type,
      required: item.required
    };
    const enums = item.enums || [];
    const items = item.items || [];
    const has_items = items?.length > 0;
    const has_enums = enums?.length > 0;
    const should_default_open = item.defaultOpen | false;
    const render_child_item = () => {
      const child_props = {
        title: has_enums ? "Possible enum values" : "properties"
      };
      if (should_default_open) child_props.defaultOpen = true;
      const has_inline_enums = has_enums && enums.every(enum_item => typeof enum_item === 'string') && enums.map((enum_item, idx) => {
        const is_last = idx === enums.length - 1;
        const is_2nd_to_last = idx === enums.length - 2;
        return <>
            <code>{enum_item}</code>
            {is_last && ''}
            {is_2nd_to_last && ' or '}
            {!is_last && !is_2nd_to_last && ', '}
          </>;
      });
      const enum_list = has_enums && !has_inline_enums && <Accordion {...child_props}>
          {enums.map(enum_item => <>
              <code>{enum_item.name}</code>
              <br />
              <p>{enum_item.description}</p>
            </>)}
        </Accordion>;
      const item_list = has_items && <Expandable {...child_props}>
          <ParamList items={items || []} is_child />
        </Expandable>;
      return <>
          <p>
            {item.description}
            {has_inline_enums && [has_inline_enums.length > 1 ? ' One of ' : ' Must be ', ...has_inline_enums]}
          </p>

          {enum_list}
          {item_list}
        </>;
    };
    return is_child ? <ResponseField {...field_props}>{render_child_item()}</ResponseField> : <ParamField {...field_props}>{render_child_item()}</ParamField>;
  });
};

Bring-Your-Own Know-Your-Consumer (BYO KYC) creates a new {entity_verification_session_name} to inform Method that this Entity's identity has already been verified via non-Method verifications skipping the identity verification requirement.

<Note>This Verification type is restricted and require pre-approval. Contact your Method CSM for more information.</Note>

## Path Parameters

<ParamList
  items={[
  {
    name: "ent_id",
    type: "string",
    description: "The ID of the Entity.",
  },
  ]}
/>

## Body

<ParamList
  items={[
  {
    name: "type",
    type: "enum",
    required: true,
    description: `The ${entity_verification_session_name} will be verifying the Entity's identity.`,
    enums: ["identity"],
  },
  {
    name: "method",
    type: "enum",
    required: true,
    description: `The Entity's identity was verified via non-Method verifications.`,
    enums: ["byo_kyc"],
  },
  {
    name: "byo_kyc",
    type: "object",
    required: true,
    description: "The BYO KYC verification configuration.",
  },
  ]}
/>

## Returns

Returns an {entity_verification_session_name} object.

<RequestExample>
  ```bash cURL
  curl https://production.methodfi.com/entities/ent_XgYkTdiHyaz3e/verification_sessions \
    -X POST \
    -H "Authorization: Bearer sk_WyZEWVfTcH7GqmPzUPk65Vjc"
    -H "Content-Type: application/json" \
    -d '{
      "type": "identity",
      "method": "byo_kyc",
      "byo_kyc": {}
    }'
  ```

  ```javascript Node.js
  const response = await method
    .entities("ent_XgYkTdiHyaz3e")
    .verificationSessions
    .create({
      type: "identity",
      method: "byo_kyc",
      byo_kyc: {},
    });
  ```

  ```python Python
  response = method
    .entities('ent_XgYkTdiHyaz3e')
    .verification_sessions
    .create({
      'type': 'identity',
      'method': 'byo_kyc',
      'byo_kyc': {}
    })
  ```
</RequestExample>

<ResponseExample>
  ```json Response
  {
    "id": "evf_3VT3bHTCnPbrm",
    "entity_id": "ent_XgYkTdiHyaz3e",
    "status": "verified",
    "type": "identity",
    "method": "byo_kyc",
    "byo_kyc": {
      "authenticated": true
    },
    "error": null,
    "created_at": "2024-04-10T16:40:16.271Z",
    "updated_at": "2024-04-10T16:40:16.271Z"
  }
  ```
</ResponseExample>


# Create a BYO SMS Verification

POST /entities/{ent_id}/verification_sessions

export const entity_verification_session_name = "EntityVerificationSession";

export const ParamList = ({items, is_child = false}) => {
  return items.map(item => {
    const field_props = {
      id: Math.random().toString(),
      body: item.name,
      name: item.name,
      type: item.type,
      required: item.required
    };
    const enums = item.enums || [];
    const items = item.items || [];
    const has_items = items?.length > 0;
    const has_enums = enums?.length > 0;
    const should_default_open = item.defaultOpen | false;
    const render_child_item = () => {
      const child_props = {
        title: has_enums ? "Possible enum values" : "properties"
      };
      if (should_default_open) child_props.defaultOpen = true;
      const has_inline_enums = has_enums && enums.every(enum_item => typeof enum_item === 'string') && enums.map((enum_item, idx) => {
        const is_last = idx === enums.length - 1;
        const is_2nd_to_last = idx === enums.length - 2;
        return <>
            <code>{enum_item}</code>
            {is_last && ''}
            {is_2nd_to_last && ' or '}
            {!is_last && !is_2nd_to_last && ', '}
          </>;
      });
      const enum_list = has_enums && !has_inline_enums && <Accordion {...child_props}>
          {enums.map(enum_item => <>
              <code>{enum_item.name}</code>
              <br />
              <p>{enum_item.description}</p>
            </>)}
        </Accordion>;
      const item_list = has_items && <Expandable {...child_props}>
          <ParamList items={items || []} is_child />
        </Expandable>;
      return <>
          <p>
            {item.description}
            {has_inline_enums && [has_inline_enums.length > 1 ? ' One of ' : ' Must be ', ...has_inline_enums]}
          </p>

          {enum_list}
          {item_list}
        </>;
    };
    return is_child ? <ResponseField {...field_props}>{render_child_item()}</ResponseField> : <ParamField {...field_props}>{render_child_item()}</ParamField>;
  });
};

Bring-Your-Own SMS (BYO SMS) creates a new {entity_verification_session_name} to inform Method that this Entity's phone number has already been verified via non-Method verifications skipping the phone verification requirement.

<Note>This Verification type is restricted and require pre-approval. Contact your Method CSM for more information.</Note>

## Path Parameters

<ParamList
  items={[
  {
    name: "ent_id",
    type: "string",
    description: "The ID of the Entity.",
  },
  ]}
/>

## Body

<ParamList
  items={[
  {
    name: "type",
    type: "enum",
    required: true,
    description: `The ${entity_verification_session_name} will be verifying the Entity's phone.`,
    enums: ["phone"],
  },
  {
    name: "method",
    type: "enum",
    required: true,
    description: `The Entity's phone was verified via non-Method verifications.`,
    enums: ["byo_sms"],
  },
  {
    name: "byo_sms",
    type: "object",
    required: true,
    description: "The BYO SMS verification configuration.",
    items: [
      {
        name: "byo_sms.timestamp",
        type: "string",
        required: true,
        description: `Timestamp of when the phone was verified.`,
      },
    ],
  },
  ]}
/>

## Returns

Returns an {entity_verification_session_name} object.

<RequestExample>
  ```bash cURL
  curl https://production.methodfi.com/entities/ent_XgYkTdiHyaz3e/verification_sessions \
    -X POST \
    -H "Authorization: Bearer sk_WyZEWVfTcH7GqmPzUPk65Vjc"
    -H "Content-Type: application/json" \
    -d '{
      "type": "phone",
      "method": "byo_sms",
      "byo_sms": {
        "timestamp": "2023-12-28T14:35:15.816Z"
      }
    }'
  ```

  ```javascript Node.js
  const response = await method
    .entities("ent_XgYkTdiHyaz3e")
    .verificationSessions
    .create({
      type: "phone",
      method: "byo_sms",
      byo_sms: {
        timestamp: "2023-12-28T14:35:15.816Z",
      },
    });
  ```

  ```python Python
  response = method
    .entities('ent_XgYkTdiHyaz3e')
    .verification_sessions
    .create({
      'type': 'phone',
      'method': 'byo_sms',
      'byo_sms': {
        'timestamp': '2023-12-28T14:35:15.816Z'
      }
    })
  ```
</RequestExample>

<ResponseExample>
  ```json Response
  {
    "id": "evf_3VT3bHTCnPbrm",
    "entity_id": "ent_XgYkTdiHyaz3e",
    "status": "verified",
    "type": "phone",
    "method": "byo_sms",
    "byo_sms": {
      "timestamp": "2023-12-28T14:35:15.816Z"
    },
    "error": null,
    "created_at": "2024-04-10T16:40:16.271Z",
    "updated_at": "2024-04-10T16:40:16.271Z"
  }
  ```
</ResponseExample>


# Create a KBA Verification

POST /entities/{ent_id}/verification_sessions

export const entity_verification_session_name = "EntityVerificationSession";

export const ParamList = ({items, is_child = false}) => {
  return items.map(item => {
    const field_props = {
      id: Math.random().toString(),
      body: item.name,
      name: item.name,
      type: item.type,
      required: item.required
    };
    const enums = item.enums || [];
    const items = item.items || [];
    const has_items = items?.length > 0;
    const has_enums = enums?.length > 0;
    const should_default_open = item.defaultOpen | false;
    const render_child_item = () => {
      const child_props = {
        title: has_enums ? "Possible enum values" : "properties"
      };
      if (should_default_open) child_props.defaultOpen = true;
      const has_inline_enums = has_enums && enums.every(enum_item => typeof enum_item === 'string') && enums.map((enum_item, idx) => {
        const is_last = idx === enums.length - 1;
        const is_2nd_to_last = idx === enums.length - 2;
        return <>
            <code>{enum_item}</code>
            {is_last && ''}
            {is_2nd_to_last && ' or '}
            {!is_last && !is_2nd_to_last && ', '}
          </>;
      });
      const enum_list = has_enums && !has_inline_enums && <Accordion {...child_props}>
          {enums.map(enum_item => <>
              <code>{enum_item.name}</code>
              <br />
              <p>{enum_item.description}</p>
            </>)}
        </Accordion>;
      const item_list = has_items && <Expandable {...child_props}>
          <ParamList items={items || []} is_child />
        </Expandable>;
      return <>
          <p>
            {item.description}
            {has_inline_enums && [has_inline_enums.length > 1 ? ' One of ' : ' Must be ', ...has_inline_enums]}
          </p>

          {enum_list}
          {item_list}
        </>;
    };
    return is_child ? <ResponseField {...field_props}>{render_child_item()}</ResponseField> : <ParamField {...field_props}>{render_child_item()}</ParamField>;
  });
};

Knowledge-Based Authentication (KBA) creates a new {entity_verification_session_name} for verifying an Entity's identity via Method's KBA verification process.

This starts the verification process by sending a list of security "out-of-wallet" questions in the response for the Entity to answer to verify their identity.

## Path Parameters

<ParamList
  items={[
  {
    name: "ent_id",
    type: "string",
    description: "The ID of the Entity.",
  },
  ]}
/>

## Body

<ParamList
  items={[
  {
    name: "type",
    type: "enum",
    required: true,
    description: `The ${entity_verification_session_name} will be verifying the Entity's identity.`,
    enums: ["identity"],
  },
  {
    name: "method",
    type: "enum",
    required: true,
    description: `The ${entity_verification_session_name} will be using Method's KBA verification process.`,
    enums: ["kba"],
  },
  {
    name: "kba",
    type: "object",
    required: true,
    description: "The KBA verification configuration.",
  },
  ]}
/>

## Returns

Returns an {entity_verification_session_name} object.

<RequestExample>
  ```bash cURL
  curl https://production.methodfi.com/entities/ent_hy3xhPDfWDVxi/verification_sessions \
    -X POST \
    -H "Authorization: Bearer sk_WyZEWVfTcH7GqmPzUPk65Vjc"
    -H "Content-Type: application/json" \
    -d '{
      "type": "identity",
      "method": "kba",
      "kba": {}
    }'
  ```

  ```javascript Node.js
  const response = await method
    .entities("ent_hy3xhPDfWDVxi")
    .verificationSessions
    .create({
      type: "identity",
      method: "kba",
      kba: {},
    });
  ```

  ```python Python
  response = method
    .entities('ent_hy3xhPDfWDVxi')
    .verification_sessions
    .create({
      'type': 'identity',
      'method': 'kba',
      'kba': {}
    })
  ```
</RequestExample>

<ResponseExample>
  ```json Response
  {
    "id": "evf_ywizPrR6WDxDG",
    "entity_id": "ent_hy3xhPDfWDVxi",
    "status": "in_progress",
    "type": "identity",
    "method": "kba",
    "kba": {
      "questions": [
        {
          "id": "qtn_xgP6cGhq34fHW",
          "text": "Which of these street names are you associated with?",
          "answers": [
            {
              "text": "21st (Correct)",
              "id": "ans_dbKCwDGwrrBgi"
            },
            {
              "text": "Majestic (Incorrect)",
              "id": "ans_8mpbq3AYPBt9z"
            },
            {
              "text": "Northland (Incorrect)",
              "id": "ans_bwtghTrmgRwDF"
            },
            {
              "text": "Southbridge (Incorrect)",
              "id": "ans_LjBPkzyVRfMGw"
            },
            {
              "text": "None of the Above (Incorrect)",
              "id": "ans_Cw6VGEwYTNdhD"
            }
          ]
        },
        {
          "id": "qtn_kmfdEftQ9zc6T",
          "text": "What is the monthly payment of your most recent auto loan or lease?",
          "answers": [
            {
              "text": "$201 - $300 (Correct)",
              "id": "ans_LXN83xnJAUNFb"
            },
            {
              "text": "$301 - $400 (Incorrect)",
              "id": "ans_C9RKnNAaxQn4m"
            },
            {
              "text": "$501 - $600 (Incorrect)",
              "id": "ans_9nqVjtNhXykLC"
            },
            {
              "text": "$601 - $700 (Incorrect)",
              "id": "ans_9qBFfNDy7fP4K"
            },
            {
              "text": "None of the Above (Incorrect)",
              "id": "ans_kEQHmaDrYDRF8"
            }
          ]
        },
        {
          "id": "qtn_6mWegPLBpAFxb",
          "text": "Which of the following is a current or previous employer?",
          "answers": [
            {
              "text": "Forward Lending Inc (Correct)",
              "id": "ans_EKi47D8wA6YN3"
            },
            {
              "text": "Network Appliance (Incorrect)",
              "id": "ans_prxEE8KhVkyWt"
            },
            {
              "text": "Northwest Community Healthcare (Incorrect)",
              "id": "ans_EYnd7dPzMbnaN"
            },
            {
              "text": "Russell Investment Group (Incorrect)",
              "id": "ans_7pCJRChVMN4tD"
            },
            {
              "text": "None of the Above (Incorrect)",
              "id": "ans_Mh7MMg7azapNq"
            }
          ]
        }
      ],
      "authenticated": false
    },
    "error": null,
    "created_at": "2024-04-11T19:23:44.727Z",
    "updated_at": "2024-04-11T19:23:44.727Z"
  }
  ```
</ResponseExample>


# Create an SMS Verification

POST /entities/{ent_id}/verification_sessions

export const entity_verification_session_name = "EntityVerificationSession";

export const ParamList = ({items, is_child = false}) => {
  return items.map(item => {
    const field_props = {
      id: Math.random().toString(),
      body: item.name,
      name: item.name,
      type: item.type,
      required: item.required
    };
    const enums = item.enums || [];
    const items = item.items || [];
    const has_items = items?.length > 0;
    const has_enums = enums?.length > 0;
    const should_default_open = item.defaultOpen | false;
    const render_child_item = () => {
      const child_props = {
        title: has_enums ? "Possible enum values" : "properties"
      };
      if (should_default_open) child_props.defaultOpen = true;
      const has_inline_enums = has_enums && enums.every(enum_item => typeof enum_item === 'string') && enums.map((enum_item, idx) => {
        const is_last = idx === enums.length - 1;
        const is_2nd_to_last = idx === enums.length - 2;
        return <>
            <code>{enum_item}</code>
            {is_last && ''}
            {is_2nd_to_last && ' or '}
            {!is_last && !is_2nd_to_last && ', '}
          </>;
      });
      const enum_list = has_enums && !has_inline_enums && <Accordion {...child_props}>
          {enums.map(enum_item => <>
              <code>{enum_item.name}</code>
              <br />
              <p>{enum_item.description}</p>
            </>)}
        </Accordion>;
      const item_list = has_items && <Expandable {...child_props}>
          <ParamList items={items || []} is_child />
        </Expandable>;
      return <>
          <p>
            {item.description}
            {has_inline_enums && [has_inline_enums.length > 1 ? ' One of ' : ' Must be ', ...has_inline_enums]}
          </p>

          {enum_list}
          {item_list}
        </>;
    };
    return is_child ? <ResponseField {...field_props}>{render_child_item()}</ResponseField> : <ParamField {...field_props}>{render_child_item()}</ParamField>;
  });
};

Creates a new {entity_verification_session_name} for an entity to verify their phone via Method's SMS verification process.

This starts the verification process by sending a SMS code to the entity's phone number on record.
The entity will then need to provide the SMS code to verify their phone number.

## Path Parameters

<ParamList
  items={[
  {
    name: "ent_id",
    type: "string",
    description: "The ID of the Entity.",
  },
  ]}
/>

## Body

<ParamList
  items={[
  {
    name: "type",
    type: "enum",
    required: true,
    description: `The ${entity_verification_session_name} will be verifying the entity's phone.`,
    enums: ["phone"],
  },
  {
    name: "method",
    type: "enum",
    required: true,
    description: `The ${entity_verification_session_name} will be using Method's SMS verification process.`,
    enums: ["sms"],
  },
  {
    name: "sms",
    type: "object",
    required: true,
    description: "The SMS verification configuration.",
  },
  ]}
/>

## Returns

Returns an {entity_verification_session_name} object.

<RequestExample>
  ```bash cURL
  curl https://production.methodfi.com/entities/ent_au22b1fbFJbp8/verification_sessions \
    -X POST \
    -H "Authorization: Bearer sk_WyZEWVfTcH7GqmPzUPk65Vjc"
    -H "Content-Type: application/json" \
    -d '{
      "type": "phone",
      "method": "sms",
      "sms": {}
    }'
  ```

  ```javascript Node.js
  const response = await method
    .entities("ent_au22b1fbFJbp8")
    .verificationSessions
    .create({
      type: "phone",
      method: "sms",
      sms: {},
    });
  ```

  ```python Python
  response = method
    .entities('ent_au22b1fbFJbp8')
    .verification_sessions
    .create({
      'type': 'phone',
      'method': 'sms',
      'sms': {}
    })
  ```
</RequestExample>

<ResponseExample>
  ```json Response
  {
    "id": "evf_3VT3bHTCnPbrm",
    "entity_id": "ent_au22b1fbFJbp8",
    "status": "in_progress",
    "type": "phone",
    "method": "sms",
    "sms": {},
    "error": null,
    "created_at": "2024-04-10T16:40:16.271Z",
    "updated_at": "2024-04-10T16:40:16.271Z"
  }
  ```
</ResponseExample>


# Create an SNA Verification

POST /entities/{ent_id}/verification_sessions

export const entity_verification_session_name = "EntityVerificationSession";

export const ParamList = ({items, is_child = false}) => {
  return items.map(item => {
    const field_props = {
      id: Math.random().toString(),
      body: item.name,
      name: item.name,
      type: item.type,
      required: item.required
    };
    const enums = item.enums || [];
    const items = item.items || [];
    const has_items = items?.length > 0;
    const has_enums = enums?.length > 0;
    const should_default_open = item.defaultOpen | false;
    const render_child_item = () => {
      const child_props = {
        title: has_enums ? "Possible enum values" : "properties"
      };
      if (should_default_open) child_props.defaultOpen = true;
      const has_inline_enums = has_enums && enums.every(enum_item => typeof enum_item === 'string') && enums.map((enum_item, idx) => {
        const is_last = idx === enums.length - 1;
        const is_2nd_to_last = idx === enums.length - 2;
        return <>
            <code>{enum_item}</code>
            {is_last && ''}
            {is_2nd_to_last && ' or '}
            {!is_last && !is_2nd_to_last && ', '}
          </>;
      });
      const enum_list = has_enums && !has_inline_enums && <Accordion {...child_props}>
          {enums.map(enum_item => <>
              <code>{enum_item.name}</code>
              <br />
              <p>{enum_item.description}</p>
            </>)}
        </Accordion>;
      const item_list = has_items && <Expandable {...child_props}>
          <ParamList items={items || []} is_child />
        </Expandable>;
      return <>
          <p>
            {item.description}
            {has_inline_enums && [has_inline_enums.length > 1 ? ' One of ' : ' Must be ', ...has_inline_enums]}
          </p>

          {enum_list}
          {item_list}
        </>;
    };
    return is_child ? <ResponseField {...field_props}>{render_child_item()}</ResponseField> : <ParamField {...field_props}>{render_child_item()}</ParamField>;
  });
};

Creates a new {entity_verification_session_name} for an entity to verify their phone via Method's SNA verification process.

This starts the verification process by sending a list of URLs in the response.
The URLs should be opened (via background XHR or mobile browser) from the Entity's device matching the phone number provided.

## Path Parameters

<ParamList
  items={[
  {
    name: "ent_id",
    type: "string",
    description: "The ID of the Entity.",
  },
  ]}
/>

## Body

<ParamList
  items={[
  {
    name: "type",
    type: "enum",
    required: true,
    description: `The ${entity_verification_session_name} will be verifying the entity's phone.`,
    enums: ["phone"],
  },
  {
    name: "method",
    type: "enum",
    required: true,
    description: `The ${entity_verification_session_name} will be using Method's SNA verification process.`,
    enums: ["sna"],
  },
  {
    name: "sna",
    type: "object",
    required: true,
    description: "The SNA verification configuration.",
  },
  ]}
/>

## Returns

Returns an {entity_verification_session_name} object.

<RequestExample>
  ```bash cURL
  curl https://production.methodfi.com/entities/ent_au22b1fbFJbp8/verification_sessions \
    -X POST \
    -H "Method-Version: 2024-04-04" \
    -H "Authorization: Bearer sk_WyZEWVfTcH7GqmPzUPk65Vjc"
    -H "Content-Type: application/json" \
    -d '{
      "type": "phone",
      "method": "sna",
      "sna": {}
    }'
  ```

  ```javascript Node.js
  const response = await method
    .entities("ent_au22b1fbFJbp8")
    .verificationSessions
    .create({
      type: "phone",
      method: "sna",
      sna: {},
    });
  ```

  ```python Python
  response = method
    .entities('ent_au22b1fbFJbp8')
    .verification_sessions
    .create({
      'type': 'phone',
      'method': 'sna',
      'sna': {}
    })
  ```
</RequestExample>

<ResponseExample>
  ```json Response
  {
    "id": "evf_qTNNzCQ63zHJ9",
    "entity_id": "ent_au22b1fbFJbp8",
    "status": "in_progress",
    "type": "phone",
    "method": "sna",
    "sna": {
      "urls": [
        "https://production.methodfi.com/sna/evf_qTNNzCQ63zHJ9/sna_vrf_yAJRRk8djWLc8",
        "https://production.methodfi.com/sna/evf_qTNNzCQ63zHJ9/sna_vrf_8AhxN68kpkHmL"
      ]
    },
    "error": null,
    "created_at": "2024-04-10T22:15:56.091Z",
    "updated_at": "2024-04-10T22:15:56.091Z"
  }
  ```
</ResponseExample>


# The entity verification sessions endpoint



export const entity_verification_session_name = "EntityVerificationSession";

export const get_common_parameters = (resource_name = 'resource') => {
  return {
    id: {
      name: 'id',
      type: "string",
      required: false,
      description: `Unique identifier for the ${resource_name}.`
    },
    entity_id: {
      name: 'entity_id',
      type: 'string',
      required: false,
      description: 'The ID of the associated Entity.'
    },
    account_id: {
      name: 'account_id',
      type: 'string',
      required: false,
      description: 'The ID of the associated Account.'
    },
    error: {
      name: 'error',
      type: 'object | null',
      required: false,
      description: <>
          An object representing an error that occurred while processing
          this {resource_name}. See <a href={`/reference/errors/${resource_name.replace(/^([A-Z])/, function (match) {
        return match.toLowerCase();
      }).replace(/([A-Z])/g, function (match) {
        return "-" + match.toLowerCase();
      })}-errors`}>{resource_name} errors</a>.
        </>
    },
    status_error: {
      name: 'status_error',
      type: 'object | null',
      required: false,
      description: <>
          An object representing an error that occurred while processing
          this {resource_name}. See <a href="/reference/errors/product-errors#status-errors">{resource_name} errors</a>.
        </>
    },
    metadata: {
      name: 'metadata',
      type: 'object | null',
      required: false,
      description: <>
          Additional data provided during creation.
          See <a href="/reference/metadata">metadata</a>
        </>
    },
    created_at: {
      name: 'created_at',
      type: 'string',
      required: false,
      description: `Timestamp of when the ${resource_name} was created.`
    },
    updated_at: {
      name: 'updated_at',
      type: 'string',
      required: false,
      description: `Timestamp of when the ${resource_name} was last updated.`
    },
    status: (enums = []) => ({
      name: 'status',
      type: 'enum',
      required: false,
      description: `Status of the ${resource_name}.`,
      enums
    }),
    type: (enums = []) => ({
      name: 'type',
      type: 'enum',
      required: false,
      description: `The type of ${resource_name}.`,
      enums
    })
  };
};

export const ParamList = ({items, is_child = false}) => {
  return items.map(item => {
    const field_props = {
      id: Math.random().toString(),
      body: item.name,
      name: item.name,
      type: item.type,
      required: item.required
    };
    const enums = item.enums || [];
    const items = item.items || [];
    const has_items = items?.length > 0;
    const has_enums = enums?.length > 0;
    const should_default_open = item.defaultOpen | false;
    const render_child_item = () => {
      const child_props = {
        title: has_enums ? "Possible enum values" : "properties"
      };
      if (should_default_open) child_props.defaultOpen = true;
      const has_inline_enums = has_enums && enums.every(enum_item => typeof enum_item === 'string') && enums.map((enum_item, idx) => {
        const is_last = idx === enums.length - 1;
        const is_2nd_to_last = idx === enums.length - 2;
        return <>
            <code>{enum_item}</code>
            {is_last && ''}
            {is_2nd_to_last && ' or '}
            {!is_last && !is_2nd_to_last && ', '}
          </>;
      });
      const enum_list = has_enums && !has_inline_enums && <Accordion {...child_props}>
          {enums.map(enum_item => <>
              <code>{enum_item.name}</code>
              <br />
              <p>{enum_item.description}</p>
            </>)}
        </Accordion>;
      const item_list = has_items && <Expandable {...child_props}>
          <ParamList items={items || []} is_child />
        </Expandable>;
      return <>
          <p>
            {item.description}
            {has_inline_enums && [has_inline_enums.length > 1 ? ' One of ' : ' Must be ', ...has_inline_enums]}
          </p>

          {enum_list}
          {item_list}
        </>;
    };
    return is_child ? <ResponseField {...field_props}>{render_child_item()}</ResponseField> : <ParamField {...field_props}>{render_child_item()}</ParamField>;
  });
};

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](/reference/entities/overview).

<Warning>
  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.
</Warning>

## Entity Verification Session Objects

<ParamList
  items={[
  get_common_parameters(entity_verification_session_name).id,
  get_common_parameters(entity_verification_session_name).entity_id,
  get_common_parameters(entity_verification_session_name).status(
    (enums = [
      {
        name: "pending",
        description: `The ${entity_verification_session_name} has been initiated. Method is gathering information to send over to verify the Entity.`,
      },
      {
        name: "in_progress",
        description: `Method has sent over information to verify the Entity and is waiting for a PUT from the client.`,
      },
      {
        name: "verified",
        description: `Method has successfully verified the Entity's phone or identity. The ${entity_verification_session_name} has successfully been completed.`,
      },
      {
        name: "failed",
        description: `The ${entity_verification_session_name} has failed due to either not being able to verify the Entity or session has expired.`,
      },
    ])
  ),
  {
    name: "type",
    type: "enum",
    description: `The type of ${entity_verification_session_name}.`,
    enums: [
      {
        name: "identity",
        description: `The ${entity_verification_session_name} is an identity verification.`,
      },
      {
        name: "phone",
        description: `The ${entity_verification_session_name} is a phone verification.`,
      },
    ],
  },
  {
    name: "method",
    type: "enum",
    description: (
      <>
        The method being used to verify this Entity's type of{" "}
        {entity_verification_session_name}. Refer to{" "}
        <a href="/reference/entities/verification-sessions/overview#verification-methods">Verification Methods</a> for more
        information.
      </>
    ),
    enums: [
      {
        name: "sms",
        description: `Verifying the Entity's phone via Method's SMS.`,
      },
      {
        name: "sna",
        description: `Verifying the Entity's phone via Method's Silent Network Authentication (SNA).`,
      },
      {
        name: "byo_sms",
        description: `Verified the Entity's phone via non-Method verification.`,
      },
      {
        name: "byo_kyc",
        description: `Verified the Entity's identity via non-Method verification.`,
      },
      {
        name: "kba",
        description: `Verifying the Entity's identity via Method's Knowledge-Based Authentication (KBA).`,
      },
      {
        name: "element",
        description: `Verifying the Entity's identity via Method's Element.`,
      },
      {
        name: "method_verified",
        description: `Method has already verified the PII provided.`,
      },
    ],
  },
  get_common_parameters(entity_verification_session_name).error,
  get_common_parameters(entity_verification_session_name).created_at,
  get_common_parameters(entity_verification_session_name).updated_at,
  ]}
/>

## Additional Properties based on method

<Tabs>
  <Tab title="sms">
    <ParamList
      items={[
      {
        name: "sms",
        type: "object | null",
        defaultOpen: true,
        description:
          "The sms object being used to store critical information related to the verification.",
        items: [
          {
            name: "sms.timestamp",
            type: "string",
            description: `Timestamp of when the phone was verified via SMS.`,
          },
        ],
      },
      ]}
    />
  </Tab>

  <Tab title="sna">
    <ParamList
      items={[
      {
        name: "sna",
        type: "object | null",
        defaultOpen: true,
        description:
          "The sna object being used to store critical information related to the verification.",
        items: [
          {
            name: "sna.urls",
            type: "string[]",
            description: `The urls that will need to be used to verify the phone.`,
          },
        ],
      },
      ]}
    />
  </Tab>

  <Tab title="byo_sms">
    <ParamList
      items={[
      {
        name: "byo_sms",
        type: "object | null",
        defaultOpen: true,
        description: `The byo_sms object used to store the timestamp that the phone was verified by a non-Method provider.`,
        items: [
          {
            name: "byo_sms.timestamp",
            type: "string",
            description: `Timestamp of when the phone was verified.`,
          },
        ],
      },
      ]}
    />
  </Tab>

  <Tab title="byo_kyc">
    <ParamList
      items={[
      {
        name: "byo_kyc",
        type: "object | null",
        defaultOpen: true,
        description: `The byo_kyc object used to store the authentication status of the Entity which was verified by a non-Method provider.`,
        items: [
          {
            name: "byo_kyc.authenticated",
            type: "boolean",
            description: `Current authentication status of the Entity's identity.`,
          },
        ],
      },
      ]}
    />
  </Tab>

  <Tab title="kba">
    <ParamList
      items={[
      {
        name: "kba",
        type: "object | null",
        defaultOpen: true,
        description:
          "The kba object being used to store critical information related to the verification.",
        items: [
          {
            name: "kba.questions",
            type: "object[]",
            description: `Questions provided by Method to verify an Entity's identity.`,
            items: [
              {
                name: "kba.questions.id",
                type: "string",
                description: `The question ID.`,
              },
              {
                name: "kba.questions.text",
                type: "string",
                description: `The corresponding text of the question.`,
              },
              {
                name: "kba.questions.answers",
                type: "object[]",
                description: `The list of answers to the question.`,
                items: [
                  {
                    name: "kba.questions.answers.id",
                    type: "string",
                    description: `The answer ID.`,
                  },
                  {
                    name: "kba.questions.answers.text",
                    type: "string",
                    description: `The corresponding text of the answer.`,
                  },
                ],
              },
            ],
          },
          {
            name: "kba.authenticated",
            type: "boolean",
            description: `Current authentication status of the Entity's identity.`,
          },
        ],
      },
      ]}
    />
  </Tab>

  <Tab title="element">
    <ParamList
      items={[
      {
        name: "element",
        type: "object | null",
        defaultOpen: true,
        description:
          "The element object being used to store critical information related to the verification.",
        items: [
          {
            name: "element.element_token",
            type: "string",
            description: `The associated element_token used to initiate the element session.`,
          },
          {
            name: "element.type",
            type: "string",
            description: `The associated type of element session.`,
          },
          {
            name: "element.timestamp",
            type: "string",
            description: (
              <>
                Timestamp of when the phone was verified via the element
                session.
                <Note>
                  This field will only appear if the{" "}
                  {entity_verification_session_name} is of type{" "}
                  <code>phone</code>
                </Note>
              </>
            ),
          },
          {
            name: "element.questions",
            type: "object[]",
            description: (
              <>
                Questions provided by Method to verify an Entity's identity. .
                <Note>
                  This field will only appear if the{" "}
                  {entity_verification_session_name} is of type{" "}
                  <code>identity</code>
                </Note>
              </>
            ),
            items: [
              {
                name: "element.questions.id",
                type: "string",
                description: `The question ID.`,
              },
              {
                name: "element.questions.text",
                type: "string",
                description: `The corresponding text of the question.`,
              },
              {
                name: "element.questions.answers",
                type: "object[]",
                description: `The list of answers to the question.`,
                items: [
                  {
                    name: "element.questions.answers.id",
                    type: "string",
                    description: `The answer ID.`,
                  },
                  {
                    name: "element.questions.answers.text",
                    type: "string",
                    description: `The corresponding text of the answer.`,
                  },
                ],
              },
            ],
          },
          {
            name: "element.authenticated",
            type: "boolean",
            description: (
              <>
                Current authentication status of the Entity's identity.
                <Note>
                  This field will only appear if the{" "}
                  {entity_verification_session_name} is of type{" "}
                  <code>identity</code>
                </Note>
              </>
            ),
          },
        ],
      },
      ]}
    />
  </Tab>
</Tabs>

## Verification Methods

| Method            | Description                                                                                                                                                                                                                                                                                           |
| ----------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `sms`             | SMS is used to verify the Entity's phone number by sending a SMS code and expecting to receive that same SMS code back to verify the phone.                                                                                                                                                           |
| `sna`             | [Silent Network Auth (SNA)](https://www.twilio.com/en-us/blog/silent-network-authentication-sna-overview) is an authentication method to confirm an Entity's phone number in the background without requiring the user to wait or leave the app.                                                      |
| `byo_sms`         | Bring-Your-Own SMS (BYO SMS) means the Entity's phone number has already been verified via a non-Method provider. Skipping phone verification requirement.                                                                                                                                            |
| `byo_kyc`         | Bring-Your-Own Know-Your-Consumer (BYO KYC) means the Entity's identity has already been verified via a non-Method provider. Skipping identity verification requirement.                                                                                                                              |
| `kba`             | [Knowledge-Based Authentication (KBA)](https://www.incognia.com/the-authentication-reference/knowledge-based-authentication-kba-meaning-and-examples) is an authentication method which confirms a person's identity by asking a series of knowledge questions which only the true owner should know. |
| `element`         | Verification has been done using a [Method Element](/reference/elements/overview).                                                                                                                                                                                                                    |
| `method_verified` | Method has already verified the PII provided.                                                                                                                                                                                                                                                         |

## Webhook Payload

The [Webhook](/reference/webhooks/overview) payload will contain the following information:

```json
{
  "id": "string",
  "type": "entity_verification_sessions.create" | "entity_verification_sessions.update",
  "path": "/entities/<ent_id>/verification_sessions/<evf_id>"
}
```

<RequestExample>
  ```json SMS
  {
    "id": "evf_3VT3bHTCnPbrm",
    "entity_id": "ent_XgYkTdiHyaz3e",
    "status": "verified",
    "type": "phone",
    "method": "sms",
    "sms": {
      "timestamp": "2024-02-25T20:02:09.718Z"
    },
    "error": null,
    "created_at": "2024-04-10T16:40:16.271Z",
    "updated_at": "2024-04-10T16:40:16.271Z"
  }
  ```

  ```json SNA
  {
    "id": "evf_qTNNzCQ63zHJ9",
    "entity_id": "ent_BYdNCVApmp7Gx",
    "status": "verified",
    "type": "phone",
    "method": "sna",
    "sna": {
      "urls": [
        "https://production.methodfi.com/sna/evf_qTNNzCQ63zHJ9/sna_vrf_yAJRRk8djWLc8",
        "https://production.methodfi.com/sna/evf_qTNNzCQ63zHJ9/sna_vrf_8AhxN68kpkHmL"
      ]
    },
    "error": null,
    "created_at": "2024-04-10T22:15:57.874Z",
    "updated_at": "2024-04-10T22:15:57.874Z"
  }
  ```

  ```json BYO SMS
  {
    "id": "evf_atWDtnMW9rnRA",
    "entity_id": "ent_au22b1fbFJbp8",
    "status": "verified",
    "type": "phone",
    "method": "byo_sms",
    "byo_sms": {
      "timestamp": "2024-02-25T20:02:09.718Z"
    },
    "error": null,
    "created_at": "2024-02-27T20:02:09.718Z",
    "updated_at": "2024-02-27T20:02:09.718Z"
  }
  ```

  ```json BYO KYC
  {
    "id": "evf_atWDtnMW9rnRA",
    "entity_id": "ent_au22b1fbFJbp8",
    "status": "verified",
    "type": "identity",
    "method": "byo_kyc",
    "byo_kyc": {
      "authenticated": true
    },
    "error": null,
    "created_at": "2024-02-27T20:02:09.718Z",
    "updated_at": "2024-02-27T20:02:09.718Z"
  }
  ```

  ```json KBA
  {
    "id": "evf_ywizPrR6WDxDG",
    "entity_id": "ent_hy3xhPDfWDVxi",
    "status": "verified",
    "type": "identity",
    "method": "kba",
    "kba": {
      "questions": [],
      "authenticated": true
    },
    "error": null,
    "created_at": "2024-04-11T19:23:44.742Z",
    "updated_at": "2024-04-11T19:23:44.742Z"
  }
  ```

  ```json Method Element (phone)
  {
    "id": "evf_atWDtnMW9rnRA",
    "entity_id": "ent_au22b1fbFJbp8",
    "status": "verified",
    "type": "phone",
    "method": "element",
    "element": {
      "element_token": "pk_elem_Y7xDijceWHjjpr8aK8bBTynwFDWbRayL",
      "type": "auth",
      "timestamp": "2024-04-11T19:39:54.735Z"
    },
    "error": null,
    "created_at": "2024-04-11T19:39:54.735Z",
    "updated_at": "2024-04-11T19:39:54.735Z"
  }
  ```

  ```json Method Element (identity)
  {
    "id": "evf_atWDtnMW9rnRA",
    "entity_id": "ent_au22b1fbFJbp8",
    "status": "verified",
    "type": "identity",
    "method": "element",
    "element": {
      "element_token": "pk_elem_twaUUGYVMzUhQ8c7rw7PtDejAh7qQAgR",
      "type": "auth",
      "questions": [],
      "authenticated": true
    },
    "error": null,
    "created_at": "2024-04-11T19:39:54.735Z",
    "updated_at": "2024-04-11T19:39:54.735Z"
  }
  ```

  ```json Method Verified (phone)
  {
    "id": "evf_rUPmzpwXmrQGc",
    "entity_id": "ent_cPfexykKCAiiL",
    "status": "verified",
    "type": "phone",
    "method": "method_verified",
    "error": null,
    "created_at": "2024-04-11T19:46:40.931Z",
    "updated_at": "2024-04-11T19:46:40.931Z"
  }
  ```

  ```json Method Verified (identity)
  {
    "id": "evf_rUPmzpwXmrQGc",
    "entity_id": "ent_cPfexykKCAiiL",
    "status": "verified",
    "type": "identity",
    "method": "method_verified",
    "error": null,
    "created_at": "2024-04-11T19:46:40.931Z",
    "updated_at": "2024-04-11T19:46:40.931Z"
  }
  ```
</RequestExample>


# Retrieve a Verification Session

GET /entities/{ent_id}/verification_sessions/{evf_id}

export const entity_verification_session_name = "EntityVerificationSession";

export const ParamList = ({items, is_child = false}) => {
  return items.map(item => {
    const field_props = {
      id: Math.random().toString(),
      body: item.name,
      name: item.name,
      type: item.type,
      required: item.required
    };
    const enums = item.enums || [];
    const items = item.items || [];
    const has_items = items?.length > 0;
    const has_enums = enums?.length > 0;
    const should_default_open = item.defaultOpen | false;
    const render_child_item = () => {
      const child_props = {
        title: has_enums ? "Possible enum values" : "properties"
      };
      if (should_default_open) child_props.defaultOpen = true;
      const has_inline_enums = has_enums && enums.every(enum_item => typeof enum_item === 'string') && enums.map((enum_item, idx) => {
        const is_last = idx === enums.length - 1;
        const is_2nd_to_last = idx === enums.length - 2;
        return <>
            <code>{enum_item}</code>
            {is_last && ''}
            {is_2nd_to_last && ' or '}
            {!is_last && !is_2nd_to_last && ', '}
          </>;
      });
      const enum_list = has_enums && !has_inline_enums && <Accordion {...child_props}>
          {enums.map(enum_item => <>
              <code>{enum_item.name}</code>
              <br />
              <p>{enum_item.description}</p>
            </>)}
        </Accordion>;
      const item_list = has_items && <Expandable {...child_props}>
          <ParamList items={items || []} is_child />
        </Expandable>;
      return <>
          <p>
            {item.description}
            {has_inline_enums && [has_inline_enums.length > 1 ? ' One of ' : ' Must be ', ...has_inline_enums]}
          </p>

          {enum_list}
          {item_list}
        </>;
    };
    return is_child ? <ResponseField {...field_props}>{render_child_item()}</ResponseField> : <ParamField {...field_props}>{render_child_item()}</ParamField>;
  });
};

Retrieves a EntityVerificationSession for an Entity.

## Path Parameters

<ParamList
  items={[
  {
    name: "ent_id",
    type: "string",
    description: "The ID of the Entity.",
  },
  {
    name: "evf_id",
    type: "string",
    description: `The ID of the ${entity_verification_session_name}.`,
  },
  ]}
/>

## Returns

Returns an {entity_verification_session_name} object.

<RequestExample>
  ```bash cURL
  curl https://production.methodfi.com/entities/ent_au22b1fbFJbp8/verification_sessions/evf_qTNNzCQ63zHJ9 \
    -H "Authorization: Bearer sk_WyZEWVfTcH7GqmPzUPk65Vjc"
  ```

  ```javascript Node.js
  const response = await method
    .entities("ent_au22b1fbFJbp8")
    .verificationSessions
    .retrieve("evf_qTNNzCQ63zHJ9");
  ```

  ```python Python
  response = method
    .entities('ent_au22b1fbFJbp8')
    .verification_sessions
    .retrieve('evf_qTNNzCQ63zHJ9')
  ```
</RequestExample>

<ResponseExample>
  ```json SMS
  {
    "id": "evf_qTNNzCQ63zHJ9",
    "entity_id": "ent_au22b1fbFJbp8",
    "status": "verified",
    "type": "phone",
    "method": "sms",
    "sms": {
      "timestamp": "2024-02-25T20:02:09.718Z"
    },
    "error": null,
    "created_at": "2024-04-10T16:40:16.271Z",
    "updated_at": "2024-04-10T16:40:16.271Z"
  }
  ```

  ```json SNA
  {
    "id": "evf_qTNNzCQ63zHJ9",
    "entity_id": "ent_au22b1fbFJbp8",
    "status": "verified",
    "type": "phone",
    "method": "sna",
    "sna": {
      "urls": [
        "https://production.methodfi.com/sna/evf_qTNNzCQ63zHJ9/sna_vrf_yAJRRk8djWLc8",
        "https://production.methodfi.com/sna/evf_qTNNzCQ63zHJ9/sna_vrf_8AhxN68kpkHmL"
      ]
    },
    "error": null,
    "created_at": "2024-04-10T22:15:57.874Z",
    "updated_at": "2024-04-10T22:15:57.874Z"
  }
  ```

  ```json ByoSMS
  {
    "id": "evf_qTNNzCQ63zHJ9",
    "entity_id": "ent_au22b1fbFJbp8",
    "status": "verified",
    "type": "phone",
    "method": "byo_sms",
    "byo_sms": {
      "timestamp": "2024-02-25T20:02:09.718Z"
    },
    "error": null,
    "created_at": "2024-02-27T20:02:09.718Z",
    "updated_at": "2024-02-27T20:02:09.718Z"
  }
  ```

  ```json ByoKYC
  {
    "id": "evf_qTNNzCQ63zHJ9",
    "entity_id": "ent_au22b1fbFJbp8",
    "status": "verified",
    "type": "identity",
    "method": "byo_kyc",
    "byo_kyc": {
      "authenticated": true
    },
    "error": null,
    "created_at": "2024-02-27T20:02:09.718Z",
    "updated_at": "2024-02-27T20:02:09.718Z"
  }
  ```

  ```json KBA
  {
    "id": "evf_qTNNzCQ63zHJ9",
    "entity_id": "ent_au22b1fbFJbp8",
    "status": "verified",
    "type": "identity",
    "method": "kba",
      "kba": {
      "questions": [],
      "authenticated": true
    },
    "error": null,
    "created_at": "2024-04-11T19:23:44.742Z",
    "updated_at": "2024-04-11T19:23:44.742Z"
  }
  ```

  ```json Element (phone)
  {
    "id": "evf_qTNNzCQ63zHJ9",
    "entity_id": "ent_au22b1fbFJbp8",
    "status": "verified",
    "type": "phone",
    "method": "element",
    "element": {
      "element_token": "pk_elem_Y7xDijceWHjjpr8aK8bBTynwFDWbRayL",
      "type": "auth",
      "timestamp": "2024-04-11T19:39:54.735Z"
    },
    "error": null,
    "created_at": "2024-04-11T19:39:54.735Z",
    "updated_at": "2024-04-11T19:39:54.735Z"
  }
  ```

  ```json Element (identity)
  {
    "id": "evf_qTNNzCQ63zHJ9",
    "entity_id": "ent_au22b1fbFJbp8",
    "status": "verified",
    "type": "identity",
    "method": "element",
    "element": {
      "element_token": "pk_elem_twaUUGYVMzUhQ8c7rw7PtDejAh7qQAgR",
      "type": "auth",
      "questions": [],
      "authenticated": true
    },
    "error": null,
    "created_at": "2024-04-11T19:39:54.735Z",
    "updated_at": "2024-04-11T19:39:54.735Z"
  }
  ```

  ```json MethodVerified (phone)
  {
    "id": "evf_qTNNzCQ63zHJ9",
    "entity_id": "ent_au22b1fbFJbp8",
    "status": "verified",
    "type": "phone",
    "method": "method_verified",
    "error": null,
    "created_at": "2024-04-11T19:46:40.931Z",
    "updated_at": "2024-04-11T19:46:40.931Z"
  }
  ```

  ```json MethodVerified (identity)
  {
    "id": "evf_qTNNzCQ63zHJ9",
    "entity_id": "ent_au22b1fbFJbp8",
    "status": "verified",
    "type": "identity",
    "method": "method_verified",
    "error": null,
    "created_at": "2024-04-11T19:46:40.931Z",
    "updated_at": "2024-04-11T19:46:40.931Z"
  }
  ```
</ResponseExample>


# Update a KBA Verification

PUT /entities/{ent_id}/verification_sessions/{evf_id}

export const entity_verification_session_name = "EntityVerificationSession";

export const ParamList = ({items, is_child = false}) => {
  return items.map(item => {
    const field_props = {
      id: Math.random().toString(),
      body: item.name,
      name: item.name,
      type: item.type,
      required: item.required
    };
    const enums = item.enums || [];
    const items = item.items || [];
    const has_items = items?.length > 0;
    const has_enums = enums?.length > 0;
    const should_default_open = item.defaultOpen | false;
    const render_child_item = () => {
      const child_props = {
        title: has_enums ? "Possible enum values" : "properties"
      };
      if (should_default_open) child_props.defaultOpen = true;
      const has_inline_enums = has_enums && enums.every(enum_item => typeof enum_item === 'string') && enums.map((enum_item, idx) => {
        const is_last = idx === enums.length - 1;
        const is_2nd_to_last = idx === enums.length - 2;
        return <>
            <code>{enum_item}</code>
            {is_last && ''}
            {is_2nd_to_last && ' or '}
            {!is_last && !is_2nd_to_last && ', '}
          </>;
      });
      const enum_list = has_enums && !has_inline_enums && <Accordion {...child_props}>
          {enums.map(enum_item => <>
              <code>{enum_item.name}</code>
              <br />
              <p>{enum_item.description}</p>
            </>)}
        </Accordion>;
      const item_list = has_items && <Expandable {...child_props}>
          <ParamList items={items || []} is_child />
        </Expandable>;
      return <>
          <p>
            {item.description}
            {has_inline_enums && [has_inline_enums.length > 1 ? ' One of ' : ' Must be ', ...has_inline_enums]}
          </p>

          {enum_list}
          {item_list}
        </>;
    };
    return is_child ? <ResponseField {...field_props}>{render_child_item()}</ResponseField> : <ParamField {...field_props}>{render_child_item()}</ParamField>;
  });
};

Updates an ongoing {entity_verification_session_name} for verifying an Entity's identity via Method's KBA verification process.

The Entity will response with a list of answers to the questions that were sent in the response of initializing the verification process.
Based off the results of the answers, this will determine if the Entity's identity has been verified or not.

## Path Parameters

<ParamList
  items={[
  {
    name: "ent_id",
    type: "string",
    description: "The ID of the Entity.",
  },
  {
    name: "evf_id",
    type: "string",
    description: `The ID of the ${entity_verification_session_name}.`,
  },
  ]}
/>

## Body

<ParamList
  items={[
  {
    name: "type",
    type: "enum",
    required: true,
    description: `The ${entity_verification_session_name} will be verifying the Entity's identity.`,
    enums: ["identity"],
  },
  {
    name: "method",
    type: "enum",
    required: true,
    description: `The ${entity_verification_session_name} will be using Method's KBA verification process.`,
    enums: ["kba"],
  },
  {
    name: "kba",
    type: "object",
    required: true,
    description: "The KBA verification configuration.",
    items: [
      {
        name: "kba.answers",
        type: "array",
        required: true,
        description: "The list of answers to the questions that were sent in the response of initializing the verification process.",
        items: [
          {
            name: "kba.answers.question_id",
            type: "string",
            required: true,
            description: "The ID of the question that was sent in the response of initializing the verification process.",
          },
          {
            name: "kba.answers.answer_id",
            type: "string",
            required: true,
            description: "The ID of the answer that was chosen by the user as the correct answer to the respective question.",
          },
        ],
      }
    ]
  },
  ]}
/>

## Returns

Returns an EntityVerificationSession object.

<RequestExample>
  ```bash cURL
  curl https://production.methodfi.com/entities/ent_hy3xhPDfWDVxi/verification_sessions/evf_ywizPrR6WDxDG \
    -X PUT \
    -H "Authorization: Bearer sk_WyZEWVfTcH7GqmPzUPk65Vjc"
    -H "Content-Type: application/json" \
    -d '{
      "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"
          }
        ]
      }
    }'
  ```

  ```javascript Node.js
  const response = await method
    .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"
          }
        ]
      }
    });
  ```

  ```python Python
  response = method
    .entities('ent_hy3xhPDfWDVxi')
    .verification_sessions
    .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'
          }
        ]
      }
    })
  ```
</RequestExample>

<ResponseExample>
  ```json Response
  {
    "id": "evf_ywizPrR6WDxDG",
    "entity_id": "ent_hy3xhPDfWDVxi",
    "status": "verified",
    "type": "identity",
    "method": "kba",
      "kba": {
      "questions": [],
      "authenticated": true
    },
    "error": null,
    "created_at": "2024-04-11T19:23:44.742Z",
    "updated_at": "2024-04-11T19:23:44.742Z"
  }
  ```
</ResponseExample>


# Update an SMS Verification

PUT /entities/{ent_id}/verification_sessions/{evf_id}

export const entity_verification_session_name = "EntityVerificationSession";

export const ParamList = ({items, is_child = false}) => {
  return items.map(item => {
    const field_props = {
      id: Math.random().toString(),
      body: item.name,
      name: item.name,
      type: item.type,
      required: item.required
    };
    const enums = item.enums || [];
    const items = item.items || [];
    const has_items = items?.length > 0;
    const has_enums = enums?.length > 0;
    const should_default_open = item.defaultOpen | false;
    const render_child_item = () => {
      const child_props = {
        title: has_enums ? "Possible enum values" : "properties"
      };
      if (should_default_open) child_props.defaultOpen = true;
      const has_inline_enums = has_enums && enums.every(enum_item => typeof enum_item === 'string') && enums.map((enum_item, idx) => {
        const is_last = idx === enums.length - 1;
        const is_2nd_to_last = idx === enums.length - 2;
        return <>
            <code>{enum_item}</code>
            {is_last && ''}
            {is_2nd_to_last && ' or '}
            {!is_last && !is_2nd_to_last && ', '}
          </>;
      });
      const enum_list = has_enums && !has_inline_enums && <Accordion {...child_props}>
          {enums.map(enum_item => <>
              <code>{enum_item.name}</code>
              <br />
              <p>{enum_item.description}</p>
            </>)}
        </Accordion>;
      const item_list = has_items && <Expandable {...child_props}>
          <ParamList items={items || []} is_child />
        </Expandable>;
      return <>
          <p>
            {item.description}
            {has_inline_enums && [has_inline_enums.length > 1 ? ' One of ' : ' Must be ', ...has_inline_enums]}
          </p>

          {enum_list}
          {item_list}
        </>;
    };
    return is_child ? <ResponseField {...field_props}>{render_child_item()}</ResponseField> : <ParamField {...field_props}>{render_child_item()}</ParamField>;
  });
};

Updates an ongoing {entity_verification_session_name} for an Entity to verify their phone via Method's SMS verification process.

The Entity will provide the SMS code that was sent to their phone number to complete the verification process.

## Path Parameters

<ParamList
  items={[
  {
    name: "ent_id",
    type: "string",
    description: "The ID of the Entity.",
  },
  {
    name: "evf_id",
    type: "string",
    description: `The ID of the ${entity_verification_session_name}.`,
  },
  ]}
/>

## Body

<ParamList
  items={[
  {
    name: "type",
    type: "enum",
    required: true,
    description: `The ${entity_verification_session_name} will be verifying the Entity's phone.`,
    enums: ["phone"],
  },
  {
    name: "method",
    type: "enum",
    required: true,
    description: `The ${entity_verification_session_name} will be using Method's SMS verification process.`,
    enums: ["sms"],
  },
  {
    name: "sms",
    type: "object",
    required: true,
    description: "The SMS verification configuration.",
    items: [
      {
        name: "sms.sms_code",
        type: "string",
        required: true,
        description: "The SMS code that was sent to the Entity's phone number.",
      },
    ]
  },
  ]}
/>

## Returns

Returns an Entity's verification session object.

<RequestExample>
  ```bash cURL
  curl https://production.methodfi.com/entities/ent_au22b1fbFJbp8/verification_sessions/evf_3VT3bHTCnPbrm \
    -X PUT \
    -H "Authorization: Bearer sk_WyZEWVfTcH7GqmPzUPk65Vjc"
    -H "Content-Type: application/json" \
    -d '{
      "type": "phone",
      "method": "sms",
      "sms": {
        "sms_code": "884134"
      }
    }'
  ```

  ```javascript Node.js
  const response = await method
    .entities("ent_au22b1fbFJbp8")
    .verificationSessions
    .update("evf_3VT3bHTCnPbrm", {
      type: "phone",
      method: "sms",
      sms: { sms_code: "884134" },
    });
  ```

  ```python Python
  response = method
    .entities('ent_au22b1fbFJbp8')
    .verification_sessions
    .update('evf_3VT3bHTCnPbrm', {
      'type': 'phone',
      'method': 'sms',
      'sms': { 'sms_code': '884134'}
    })
  ```
</RequestExample>

<ResponseExample>
  ```json Response
  {
    "id": "evf_3VT3bHTCnPbrm",
    "entity_id": "ent_au22b1fbFJbp8",
    "status": "verified",
    "type": "phone",
    "method": "sms",
    "sms": {
      "timestamp": "2024-04-10T16:42:03.751Z"
    },
    "error": null,
    "created_at": "2024-04-10T16:40:16.283Z",
    "updated_at": "2024-04-10T16:40:16.283Z"
  }
  ```
</ResponseExample>


# Update an SNA Verification

PUT /entities/{ent_id}/verification_sessions/{evf_id}

export const entity_verification_session_name = "EntityVerificationSession";

export const ParamList = ({items, is_child = false}) => {
  return items.map(item => {
    const field_props = {
      id: Math.random().toString(),
      body: item.name,
      name: item.name,
      type: item.type,
      required: item.required
    };
    const enums = item.enums || [];
    const items = item.items || [];
    const has_items = items?.length > 0;
    const has_enums = enums?.length > 0;
    const should_default_open = item.defaultOpen | false;
    const render_child_item = () => {
      const child_props = {
        title: has_enums ? "Possible enum values" : "properties"
      };
      if (should_default_open) child_props.defaultOpen = true;
      const has_inline_enums = has_enums && enums.every(enum_item => typeof enum_item === 'string') && enums.map((enum_item, idx) => {
        const is_last = idx === enums.length - 1;
        const is_2nd_to_last = idx === enums.length - 2;
        return <>
            <code>{enum_item}</code>
            {is_last && ''}
            {is_2nd_to_last && ' or '}
            {!is_last && !is_2nd_to_last && ', '}
          </>;
      });
      const enum_list = has_enums && !has_inline_enums && <Accordion {...child_props}>
          {enums.map(enum_item => <>
              <code>{enum_item.name}</code>
              <br />
              <p>{enum_item.description}</p>
            </>)}
        </Accordion>;
      const item_list = has_items && <Expandable {...child_props}>
          <ParamList items={items || []} is_child />
        </Expandable>;
      return <>
          <p>
            {item.description}
            {has_inline_enums && [has_inline_enums.length > 1 ? ' One of ' : ' Must be ', ...has_inline_enums]}
          </p>

          {enum_list}
          {item_list}
        </>;
    };
    return is_child ? <ResponseField {...field_props}>{render_child_item()}</ResponseField> : <ParamField {...field_props}>{render_child_item()}</ParamField>;
  });
};

Updates an ongoing {entity_verification_session_name} for an Entity to verify their phone via Method's SNA verification process.

Method will verify that the at least one of the URLs was accessed from a mobile device matching the Entity's phone number.

## Path Parameters

<ParamList
  items={[
  {
    name: "ent_id",
    type: "string",
    description: "The ID of the Entity.",
  },
  ]}
/>

## Body

<ParamList
  items={[
  {
    name: "type",
    type: "enum",
    required: true,
    description: `The ${entity_verification_session_name} will be verifying the Entity's phone.`,
    enums: ["phone"],
  },
  {
    name: "method",
    type: "enum",
    required: true,
    description: `The ${entity_verification_session_name} will be using Method's SNA verification process.`,
    enums: ["sna"],
  },
  {
    name: "sna",
    type: "object",
    required: true,
    description: "The SNA verification configuration.",
  },
  ]}
/>

## Returns

Returns an Entity's verification session object.

<RequestExample>
  ```bash cURL
  curl https://production.methodfi.com/entities/ent_BYdNCVApmp7Gx/verification_sessions/evf_qTNNzCQ63zHJ9 \
    -X PUT \
    -H "Method-Version: 2024-04-04" \
    -H "Authorization: Bearer sk_WyZEWVfTcH7GqmPzUPk65Vjc"
    -H "Content-Type: application/json" \
    -d '{
      "type": "phone",
      "method": "sna",
      "sna": {}
    }'
  ```

  ```javascript Node.js
  const response = await method
    .entities("ent_BYdNCVApmp7Gx")
    .verificationSessions
    .update("evf_qTNNzCQ63zHJ9", {
      type: "phone",
      method: "sna",
      sna: {},
    });
  ```

  ```python Python
  response = method
    .entities('ent_BYdNCVApmp7Gx')
    .verification_sessions
    .update('evf_qTNNzCQ63zHJ9', {
      'type': 'phone',
      'method': 'sna',
      'sna': {}
    })
  ```
</RequestExample>

<ResponseExample>
  ```json Response
  {
    "id": "evf_qTNNzCQ63zHJ9",
    "entity_id": "ent_BYdNCVApmp7Gx",
    "status": "verified",
    "type": "phone",
    "method": "sna",
    "sna": {
      "urls": [
        "https://production.methodfi.com/sna/evf_qTNNzCQ63zHJ9/sna_vrf_yAJRRk8djWLc8",
        "https://production.methodfi.com/sna/evf_qTNNzCQ63zHJ9/sna_vrf_8AhxN68kpkHmL"
      ]
    },
    "error": null,
    "created_at": "2024-04-10T22:15:57.874Z",
    "updated_at": "2024-04-10T22:15:57.874Z"
  }
  ```
</ResponseExample>


# Environments



Method has three primary API environments. Development, Sandbox and Production share similar functionality
with minor differences. All building should be done in the Development and Sandbox environments.
All activity in the Production will be billed. Your team will have separate API keys for each Method
environment. Keys are available under the Keys section in
the [Method Dashboard](https://dashboard.methodfi.com).

Development, Sandbox and Production share similar functionality with minor differences
listed below. All merchant data is the same across all environments.

#### Development

➡️ We recommend building your integration in the `Development` environment. All data / payments is mocked.

#### Sandbox

➡️ We recommend switching to `Sandbox` once you are ready to test your integration with live data.

*   Entities: Limited to a pre-defined whitelist. Contact your Method CSM to set up / modify your sandbox whitelist.
*   Payments: 20 transactions / month (\$1 limit / transaction)
*   Products / Subscriptions: Limited to your contracted products and subscriptions. All endpoints are live and will perform real data and money movement.

#### Production

➡️ Go live with your Method integration with unlimited live payments; all requests are billed. 🚀

<RequestExample>
  ```bash API Hosts
  https://dev.methodfi.com (Development)
  https://sandbox.methodfi.com (Sandbox)
  https://production.methodfi.com (Production)
  ```
</RequestExample>


# Account Errors



## Request Errors

The request to the `/accounts/:acc_id` endpoint failed. These are the `sub_type` that can be returned.

### `INVALID_REQUEST`

The request body failed basic validation for the specific API endpoint.

### `NOT_FOUND`

The requested resource does not exist.

### `INVALID_HOLDER_ID`

The provided `holder_id` does not match an existing entity.

### `ACCOUNT_CONSENT_ALREADY_WITHDRAWN`

Consent for this account has already been withdrawn.

### `ACCOUNT_CONSENT_ALREADY_GRANTED`

Consent for this account has already been granted.

### `ACCOUNT_HAS_PAYMENT_IN_PROGRESS`

Consent for this account cannot be withdrawn as it has one or more associated payments in progress.

***

## Resource Errors

Errors set on an Account's `error` property for processes that are unsuccessful.

### `11001 – ACCOUNT_INVALID_DETAILS`

The details on the Account are invalid as reported by the FI.

#### Causes

*   Incorrect Account information - the account number or routing number is incorrect.
*   The Account could not be located.

```json
{
  "type": "ACCOUNT_DISABLED",
  "code": 11001,
  "sub_type": "ACCOUNT_INVALID_DETAILS",
  "message": "Account was disabled due to invalid information reported by the financial institution."
}
```

#### Resolution

The Account will be disabled and all its capabilities will be removed.

***

### `11002 – ACCOUNT_CLOSED`

The Account has been closed.

#### Causes

*   Account is closed.

```json
{
  "type": "ACCOUNT_DISABLED",
  "code": 11002,
  "sub_type": "ACCOUNT_CLOSED",
  "message": "Account was disabled due to a closure in the underlying bank account."
}
```

#### Resolution

The account will be disabled and all its capabilities will be removed.

***

### `11003 – ACCOUNT_UNAUTHORIZED_PAYMENT`

The holder of the Account did not authorize a payment.

#### Causes

*   A payment was stopped by the Account holder because they didn't authorize the payment.

```json
{
  "type": "ACCOUNT_DISABLED",
  "code": 11003,
  "sub_type": "ACCOUNT_UNAUTHORIZED_PAYMENT",
  "message": "Account was disabled due to a payment reported as unauthorized by the financial institution."
}
```

#### Resolution

The account will be disabled and all its capabilities will be removed.

***


# Account Verification Session Errors



## Request Errors

The request to the `/accounts/:acc_id/verification_sessions` endpoint failed. These are the `sub_type` that can be returned.

### `INVALID_REQUEST`

The request body failed basic validation for the specific API endpoint.

### `NOT_FOUND`

The requested resource does not exist.

### `EXISTING_VERIFIED_SESSION`

The Account has already been verified.

### `EXISTING_VERIFICATION_SESSION`

The Account has an existing verification session.

### `VERIFICATION_TYPE_NOT_SUPPORTED`

The verification type provided is not supported for the merchant.

### `VERIFICATION_SESSION_ATTEMPT_LIMIT_REACHED`

The verification session attempt limit has been reached.

***

## Resource Errors

Errors set on a AccountVerificationSession's `error` property for processes that are unsuccessful.

### `16001 – VERIFICATION_TYPE_NOT_SUPPORTED`

The AccountVerificationSession has failed.

#### Causes

*   The inputted verification type is not supported for the merchant.

```json
{
  "type": "ACCOUNT_VERIFICATION_SESSION_FAILED",
  "code": 16001,
  "sub_type": "VERIFICATION_TYPE_NOT_SUPPORTED",
  "message": "The verification type provided is not supported for the merchant."
}
```

#### Resolution

*   Initiate a new AccountVerificationSession with a supported type.

***

### `16002 – INVALID_DETAILS`

The AccountVerificationSession has failed due to incorrect details.

#### Causes

*   The details required to pass verification was incorrect.

```json
{
  "type": "ACCOUNT_VERIFICATION_SESSION_FAILED",
  "code": 16002,
  "sub_type": "INVALID_DETAILS",
  "message": "The provided details are invalid for the account."
}
```

#### Resolution

*   Initiate a new AccountVerificationSession and verify the correct details is provided.

***

### `16003 – MICRO_DEPOSITS_FAILED`

The AccountVerificationSession has failed due to invalid account information.

#### Causes

*   Incorrect Account information - the account number or routing number is incorrect.
*   The Account could not be located.

```json
{
  "type": "ACCOUNT_VERIFICATION_SESSION_FAILED",
  "code": 16003,
  "sub_type": "MICRO_DEPOSITS_FAILED",
  "message": "The micro-deposits failed to verify due to invalid account information."
}
```

#### Resolution

*   The verification session has failed and the Account will be disabled.

***

### `16004 – VERIFICATION_SESSION_ATTEMPT_LIMIT_REACHED`

The AccountVerificationSession has failed due to reaching maximum number of attempts for this session.

#### Causes

*   Too many failed verification attempts for this session.

```json
{
  "type": "ACCOUNT_VERIFICATION_SESSION_FAILED",
  "code": 16004,
  "sub_type": "VERIFICATION_SESSION_ATTEMPT_LIMIT_REACHED",
  "message": "The maximum number of attempts has been reached for this account verification session."
}
```

#### Resolution

*   Initiate a new AccountVerificationSession.

***


# Balance Errors



## Request Errors

The request to the `/accounts/:acc_id/balances` endpoint failed. These are the `sub_type` that can be returned.

### `INVALID_REQUEST`

The request body failed basic validation for the specific API endpoint.

### `NOT_FOUND`

The requested resource does not exist.

### `PRODUCT_UNAVAILABLE`

This Account does not support Balance. This could be due to the Account's status
or Method currently doesn't support Balance for the Account's Financial Institution.

### `TEAM_CAPABILITY_RESTRICTED`

Your organization does not have access to Balance endpoint.

### `PRODUCT_VERIFICATION_MISSING`

Account must be verified before it can access `/accounts/:acc_id/balances` endpoint.

***

## Resource Errors

Errors set on a Balance's `error` property for processes that are unsuccessful.

### `20001 – BALANCE_TEMPORARILY_UNAVAILABLE`

There was an issue with connecting with the Account's Financial Institution and the request could not be completed.

```json
{
  "type": "BALANCE_FAILED",
  "code": 20001,
  "sub_type": "BALANCE_TEMPORARILY_UNAVAILABLE",
  "message": "Balance is temporarily unavailable for this account."
}
```

***


# Card Brand Errors



## Request Errors

The request to the `/accounts/:acc_id/card_brands` endpoint failed. These are the `sub_type` that can be returned.

### `INVALID_REQUEST`

The request body failed basic validation for the specific API endpoint.

### `NOT_FOUND`

The requested resource does not exist.

### `PRODUCT_UNAVAILABLE`

This Account's liability type isn't a credit card or the credit card network isn't Visa or Mastercard.

### `TEAM_CAPABILITY_RESTRICTED`

Your organization does not have access to CardBrand endpoint.

### `CARD_BRANDS_NOT_FOUND`

The card's brand could not be found or does not exist.

***


# Connect Errors



## Request Errors

The request to the `/entities/:ent_id/connect` endpoint failed. These are the `sub_type` that can be returned.

### `INVALID_REQUEST`

The request body failed basic validation for the specific API endpoint.

### `NOT_FOUND`

The requested resource does not exist.

### `TEAM_CAPABILITY_RESTRICTED`

Your organization does not have access to Connect endpoint.

### `ACCOUNT_CONSENT_UNAVAILABLE`

Account consent for your organization is unavailable.

### `ENTITY_VERIFICATION_MISSING`

Entity must be fully verified before they can access `/entities/:ent_id/connect` endpoint.

***


# Credit Score Errors



## Request Errors

The request to the `/entities/:ent_id/credit_scores` endpoint failed. These are the `sub_type` that can be returned.

### `INVALID_REQUEST`

The request body failed basic validation for the specific API endpoint.

### `NOT_FOUND`

The requested resource does not exist.

### `ENTITY_VERIFICATION_MISSING`

Entity must be fully verified before they can access `/entities/:ent_id/credit_scores` endpoint.

### `TEAM_CAPABILITY_RESTRICTED`

Your organization does not have access to the Credit Score endpoint.

***

## Resource Errors

Errors set on a Credit Score's `error` property for processes that are unsuccessful.

### `23001 – CREDIT_SCORE_FAILED_TEMPORARILY_UNAVAILABLE`

There was an issue with the credit score provider and the request could not be completed.

```json
{
  "type": "CREDIT_SCORE_FAILED",
  "code": 23001,
  "sub_type": "CREDIT_SCORE_FAILED_TEMPORARILY_UNAVAILABLE",
  "message": "Credit Score is temporarily unavailable for this entity."
}
```

***


# Entity Errors



## Request Errors

The request to the `/entities/:ent_id` endpoint failed. These are the `sub_type` that can be returned.

### `INVALID_REQUEST`

The request body failed basic validation for the specific API endpoint.

### `NOT_FOUND`

The requested resource does not exist.

### `DUPLICATE_ENTITY_DETAILS`

An Entity with the same details already exists.

### `INVALID_ENTITY_PHONE_NUMBER`

The provided phone number is not a valid US phone number.

### `INVALID_ENTITY_EMAIL_ADDRESS`

The provided email address is not a valid email address.

### `RESTRICTED_ENTITY_DETAILS`

The Entity's information does not match the restrictions set for your organization.

### `ENTITY_CONSENT_ALREADY_WITHDRAWN`

Consent for this Entity has already been withdrawn.

### `ENTITY_CONSENT_ALREADY_GRANTED`

Consent for this entity has already been granted.

### `ENTITY_HAS_PAYMENTS_IN_PROGRESS`

Consent for this entity cannot be withdrawn as it has one or more associated payments in progress.

### `ENTITY_INVALID_SSN`

The provided SSN is invalid. Verify your request and try again.

### `ENTITY_INVALID_SSN4`

The provided SSN4 is invalid. Verify your request and try again.

### `ENTITY_CREDIT_SCORE_NOT_FOUND`

The credit score for this entity could not be found.

### `MAX_ENTITY_METADATA_SIZE_EXCEEDED`

The max metadata object size of 1KB was exceeded.

### `ENTITY_UPDATE_RESTRICTED`

Only Entity's that have consented can be updated.

### `ENTITY_UPDATE_DISABLED`

Disabled Entities cannot be updated.

### `ENTITY_UPDATE_INVALID`

Cannot update an Entity's field that has already been set.

### `ENTITY_UPDATE_UNSUPPORTED`

This Entity cannot be updated.

***

## Resource Errors

Errors set on an Entity's `error` property for processes that are unsuccessful.

### `12001 – ENTITY_UNAUTHORIZED_PAYMENT`

The Entity was disabled due to unauthorized payments which was reported by the FI.

#### Causes

*   [Customer Revoked Authorization](https://www.moderntreasury.com/ach-return-codes/r07)
*   [Originator not known and/or not authorized to Debit Receiver’s Account](https://www.moderntreasury.com/ach-return-codes/r10)
*   [Representative Payee Deceased or Unable to Continue in That Capacity](https://www.moderntreasury.com/ach-return-codes/r14)
*   [Corporate Customer Advises Not Authorized](https://www.moderntreasury.com/ach-return-codes/r29)

```json
{
  "type": "ENTITY_DISABLED",
  "code": 12001,
  "sub_type": "ENTITY_UNAUTHORIZED_PAYMENT",
  "message": "Entity was disabled due to a payment reported as unauthorized by the financial institution."
}
```

#### Resolution

The Entity will be disabled and all its capabilities will be removed.

***

### `12002 – ENTITY_INVALID_DETAILS`

The Entity was disabled due to the information provided being invalid.

#### Causes

*   One or more PIIs provided were invalid.

```json
{
  "type": "ENTITY_DISABLED",
  "code": 12002,
  "sub_type": "ENTITY_INVALID_DETAILS",
  "message": "Entity was disabled due to invalid information."
}
```

#### Resolution

The Entity will be disabled and no capabilities will be granted.

***

### `12003 – ENTITY_PENDING_KYC_REVIEW`

The Entity was disabled due Method's provider needing to review the Entity's KYC information.

#### Causes

*   The Entity has been flagged for requiring a KYC review.

```json
{
  "type": "ENTITY_DISABLED",
  "code": 12003,
  "sub_type": "ENTITY_PENDING_KYC_REVIEW",
  "message": "Entity was disabled due to pending KYC review."
}
```

#### Resolution

The Entity will be disabled and no capabilities will be granted.

***

### `12004 – ENTITY_SSN_MISMATCH`

The Entity was disabled due to the PII provided not matching the identity the SSN belongs to.

#### Causes

*   SSN provided does not match the Entity's identity.

```json
{
  "type": "ENTITY_DISABLED",
  "code": 12004,
  "sub_type": "ENTITY_SSN_MISMATCH",
  "message": "Entity was disabled due to a mismatch in the provided and retrieved social security number."
}
```

#### Resolution

The Entity will be disabled and no capabilities will be granted.

***

### `12005 – ENTITY_CONSENT_WITHDRAWN`

The Entity was disabled due to consent being withdrawn.

#### Causes

*   The Entity has withdrawn consent.

```json
{
  "type": "ENTITY_DISABLED",
  "code": 12005,
  "sub_type": "ENTITY_CONSENT_WITHDRAWN",
  "message": "Entity was disabled due to consent withdrawal."
}
```

#### Resolution

The Entity will be disabled and all its capabilities will be removed.

***


# Entity Verification Session Errors



## Request Errors

The request to the `/entities/:ent_id/verification_sessions` endpoint failed. These are the `sub_type` that can be returned.

### `INVALID_REQUEST`

The request body failed basic validation for the specific API endpoint.

### `NOT_FOUND`

The requested resource does not exist.

### `ENTITY_PHONE_VERIFICATION_MAX_ATTEMPTS`

The Entity has reached the maximum number of phone verification attempts.

### `EXISTING_VERIFIED_SESSION`

The Entity has already completed the verification for that EntityVerificationSession `type`.

### `MISSING_IDENTITY_MATCH`

The Entity's identity couldn't be found. Update the Entity's PII to improve the chances of finding the identity.

### `MISSING_PHONE_VERIFICATION`

The Entity's phone number has not been verified yet.

### `UNAUTHORIZED_VERIFICATION_METHOD`

The Entity is unauthorized to use the verification method provided.

### `INVALID_ENTITY_TYPE`

The Entity must by of type `individual` to use the EntityVerificationSession endpoint.

### `VERIFICATION_SESSION_EXPIRED`

A response back to Method took too long and the EntityVerificationSession has expired.

### `VERIFICATION_SESSION_FAILED_INCORRECT_SMS_CODE`

The Entity's phone number couldn't be verified through the SMS code provided.

### `VERIFICATION_SESSION_FAILED_SNA`

The verification process failed to verify the entity's phone number through SNA.

### `VERIFICATION_SESSION_FAILED_INVALID_ANSWER`

The Entity's identity couldn't be verified through the answer provided.

***

## Resource Errors

Errors set on a EntityVerificationSession's `error` property for processes that are unsuccessful.

### `19001 – VERIFICATION_SESSION_EXPIRED`

The EntityVerificationSession has expired. The verification process must be re-initiated.

#### Causes

*   The EntityVerificationSession was not completed in the allotted time.

```json
{
  "type": "VERIFICATION_SESSION_FAILED",
  "code": 19001,
  "sub_type": "VERIFICATION_SESSION_EXPIRED",
  "message": "The verification session has expired. Please re-initiate the verification process."
}
```

#### Resolution

*   Initiate a new EntityVerificationSession.

***

### `19002 – VERIFICATION_SESSION_FAILED_INCORRECT_SMS_CODE`

The Entity's phone number couldn't be verified through the SMS code provided.

#### Causes

*   The individual inputted an incorrect SMS code.

```json
{
  "type": "VERIFICATION_SESSION_FAILED",
  "code": 19002,
  "sub_type": "VERIFICATION_SESSION_FAILED_INCORRECT_SMS_CODE",
  "message": "The SMS code inputted is invalid. Please re-initiate the verification process."
}
```

#### Resolution

*   Initiate a new EntityVerificationSession and make sure the individual is inputting the correct SMS code.

***

### `19003 – VERIFICATION_SESSION_FAILED_SNA`

The verification process failed to verify the Entity's phone number through SNA.

#### Causes

*   The individual is not on a mobile device.
*   The individual is not on a network that supports SNA.

```json
{
  "type": "VERIFICATION_SESSION_FAILED",
  "code": 19003,
  "sub_type": "VERIFICATION_SESSION_FAILED_SNA",
  "message": "The entity's phone couldn't be verified through SNA. Please re-initiate the verification process."
}
```

#### Resolution

*   Confirm the individual is on a mobile device.
*   Attempt a different verification method.

***

### `19004 – VERIFICATION_SESSION_FAILED_INVALID_ANSWER`

The Entity's identity couldn't be verified through the answer provided.

#### Causes

*   The individual answered one or more questions incorrectly.
*   One or more questions was missing in the request.

```json
{
  "type": "VERIFICATION_SESSION_FAILED",
  "code": 19004,
  "sub_type": "VERIFICATION_SESSION_FAILED_INVALID_ANSWER",
  "message": "Invalid entity identity answer. An answer is either missing or invalid. Please re-initiate the verification process."
}
```

#### Resolution

*   Initiate a new EntityVerificationSession and confirm that the individual is answering the questions correctly.

***


# Identity Errors



## Request Errors

The request to the `/entities/:ent_id/identities` endpoint failed. These are the `sub_type` that can be returned.

### `INVALID_REQUEST`

The request body failed basic validation for the specific API endpoint.

### `NOT_FOUND`

The requested resource does not exist.

### `TEAM_CAPABILITY_RESTRICTED`

The organization does not have access to Identity endpoint.

### `PRODUCT_RESTRICTED`

The entity requires a phone number to access Identity endpoint.

### `NO_IDENTITIES_FOUND`

No identities were found for the entity.

***


# Payment Errors



## Request Errors

The request to the `/payments` endpoint failed. These are the `sub_type` that can be returned.

### `INVALID_REQUEST`

The request body failed basic validation for the specific API endpoint.

### `NOT_FOUND`

The requested resource does not exist.

### `INVALID_AMOUNT_TYPE`

Amount type should be integers expressed as decimals.

### `INVALID_AMOUNT`

The minimum amount for a payment is 100 cents ($1.00). The maximum amount for a payment is 100,000,000 cents ($1,000,000.00).

### `INVALID_ACH_DESCRIPTION`

The ACH description should be a string with a maximum of 10 characters.

### `INVALID_SOURCE`

Source Account provided is invalid. Account either doesn't exist or is not active.

### `INVALID_SOURCE_HOLDER`

Source Account holder is inactive.

### `INVALID_SOURCE_HOLDER_CAPABILITIES`

Source Account holder is not allowed to send funds.

### `INVALID_SOURCE_HOLDER_LIMITED`

Source Account holder is limited to sending funds from Accounts linked using Method Link (Plaid / MX).

### `INVALID_SOURCE_LIABILITY`

Source Account cannot be of type `liability`.

### `INVALID_DESTINATION`

Destination Account provided is invalid. Account either doesn't exist or is not active.

### `INVALID_DESTINATION_HOLDER`

Destination Account holder is not allowed to receive funds.

### `INVALID_TEST_DESTINATION`

Destination Account was created before live mode was enabled.

### `INVALID_TEST_SOURCE`

Source Account was created before live mode was enabled.

### `INVALID_TRANSFER`

Cannot transfer funds between the same Account.

### `MAX_AMOUNT_EXCEEDED`

The organization's max one-time transfer amount exceeded.

### `MAX_REQUEST_LIMIT`

The organization's monthly payment request limit has been reached. Contact support to extend this limit.

### `MAX_PAYMENT_METADATA_SIZE_EXCEEDED`

Max metadata object size of 1KB exceeded.

### `INSUFFICIENT_FUNDS`

Source Account has insufficient funds.

### `INVALID_SOURCE_CAPABILITIES`

Source Account is not verified to send payments.

### `INVALID_DESTINATION_CAPABILITIES`

Destination Account is not verified to receive payments.

### `INVALID_DESTINATION_BALANCE`

Destination Account has a balance of \$0.

### `INVALID_SOURCE_SINGLE_USE_CLEARING`

Source Account is a single-use clearing account, and has already been used for a payment.

***

## Resource Errors

Errors set on a Payment's `error` property for processes that are unsuccessful.

### `10001 – PAYMENT_INSUFFICIENT_FUNDS`

Payment failed due to insufficient funds from the source Account.

```json
{
  "type": "PAYMENT_FAILED",
  "code": 10001,
  "sub_type": "PAYMENT_INSUFFICIENT_FUNDS",
  "message": "Payment failed due to insufficient funds from the source account."
}
```

***

### `10002 – PAYMENT_UNAUTHORIZED`

The Payment was unauthorized by the source or destination Account holder.

```json
{
  "type": "PAYMENT_FAILED",
  "code": 10002,
  "sub_type": "PAYMENT_UNAUTHORIZED",
  "message": "Payment failed due to a report by the source or destination account holder as unauthorized."
}
```

***

### `10003 – PAYMENT_INVALID_ACCOUNT`

The Payment failed due to an invalid source or destination Account. The Account is either inactive or does not exist.

```json
{
  "type": "PAYMENT_FAILED",
  "code": 10003,
  "sub_type": "PAYMENT_INVALID_ACCOUNT",
  "message": "Payment failed due to an invalid source or destination account."
}
```

***

### `10004 – PAYMENT_CANCELED_INSUFFICIENT_FUNDS`

Payment was canceled due to insufficient funds from the source Account.

```json
{
  "type": "PAYMENT_CANCELED",
  "code": 10004,
  "sub_type": "PAYMENT_INSUFFICIENT_FUNDS",
  "message": "Payment was canceled due to insufficient funds from the source account."
}
```

***

### `10005 – PAYMENT_UNAUTHORIZED_SOURCE`

The Payment failed due to a report by the source Account holder as unauthorized.

```json
{
  "type": "PAYMENT_FAILED",
  "code": 10005,
  "sub_type": "PAYMENT_UNAUTHORIZED_SOURCE",
  "message": "Payment failed due to a report by the source account holder as unauthorized."
}
```

***

### `10006 – PAYMENT_UNAUTHORIZED_DESTINATION`

The Payment failed due to a report by the destination Account holder as unauthorized.

```json
{
  "type": "PAYMENT_FAILED",
  "code": 10006,
  "sub_type": "PAYMENT_UNAUTHORIZED_DESTINATION",
  "message": "Payment failed due to a report by the destination account holder as unauthorized."
}
```

***

### `10007 – PAYMENT_INVALID_SOURCE_ACCOUNT`

The source Account is invalid. The Account is either inactive or does not exist.

```json
{
  "type": "PAYMENT_FAILED",
  "code": 10007,
  "sub_type": "PAYMENT_INVALID_SOURCE_ACCOUNT",
  "message": "Payment failed due to an invalid source account."
}
```

***

### `10008 – PAYMENT_INVALID_DESTINATION_ACCOUNT`

The destination Account is invalid. The Account is either inactive or does not exist.

```json
{
  "type": "PAYMENT_FAILED",
  "code": 10008,
  "sub_type": "PAYMENT_INVALID_DESTINATION_ACCOUNT",
  "message": "Payment failed due to an invalid destination account."
}
```

***

### `10009 – PAYMENT_REJECTED_BY_DESTINATION_INSTITUTION`

The Payment was rejected by the destination Account's FI.

```json
{
  "type": "PAYMENT_FAILED",
  "code": 10009,
  "sub_type": "PAYMENT_REJECTED_BY_DESTINATION_INSTITUTION",
  "message": "Payment failed due to a rejection by the destination account's financial institution."
}
```

***

### `10010 – PAYMENT_REJECTED_INVALID_AMOUNT`

The payment failed due to a rejection by the destination account's financial institution to accept the payment amount.

```json
{
  "type": "PAYMENT_FAILED",
  "code": 10010,
  "sub_type": "PAYMENT_REJECTED_INVALID_AMOUNT",
  "message": "Payment failed due to a rejection by the destination account's financial institution to accept the payment amount."
}
```

***


# Payment Reversal Errors



## Request Errors

The request to the `/payments/:pmt_id/reversals` endpoint failed. These are the `sub_type` that can be returned.

### `INVALID_REQUEST`

The request body failed basic validation for the specific API endpoint.

### `NOT_FOUND`

The requested resource does not exist.

### `INVALID_REVERSAL_STATUS`

Cannot update Reversal if status is not `pending_approval`.

***

## Resource Errors

Errors set on a Reversal's `error` property for processes that are unsuccessful.

### `14001 – PAYMENT_REVERSAL_INSUFFICIENT_FUNDS`

The Reversal failed due to Account having insufficient funds.

```json
{
  "type": "PAYMENT_REVERSAL_FAILED",
  "code": 14001,
  "sub_type": "PAYMENT_REVERSAL_INSUFFICIENT_FUNDS",
  "message": "Payment reversal failed due to insufficient funds from the account."
}
```

***

### `14002 – PAYMENT_UNAUTHORIZED`

The Reversal failed due to a report by the Account holder as unauthorized.

```json
{
  "type": "PAYMENT_REVERSAL_FAILED",
  "code": 14002,
  "sub_type": "PAYMENT_REVERSAL_UNAUTHORIZED",
  "message": "Payment reversal failed due to a report by the account holder as unauthorized."
}
```

***

### `14003 – PAYMENT_INVALID_ACCOUNT`

The Reversal failed due to an invalid Account. The Account is either inactive or does not exist.

```json
{
  "type": "PAYMENT_REVERSAL_FAILED",
  "code": 14003,
  "sub_type": "PAYMENT_REVERSAL_INVALID_ACCOUNT",
  "message": "Payment reversal failed due to an invalid account."
}
```

***


# Payoff Errors



## Request Errors

The request to the `/accounts/:acc_id/payoffs` endpoint failed. These are the `sub_type` that can be returned.

### `INVALID_REQUEST`

The request body failed basic validation for the specific API endpoint.

### `NOT_FOUND`

The requested resource does not exist.

### `PRODUCT_UNAVAILABLE`

This Account does not support Payoffs. This could be due to the Account's status, the Account's liability type
or Method currently doesn't support Payoffs for the Account's Financial Institution.

### `TEAM_CAPABILITY_RESTRICTED`

Your organization does not have access to Payoff endpoint.

### `PRODUCT_VERIFICATION_MISSING`

Account must be verified before it can access `/accounts/:acc_id/payoffs` endpoint.

***

## Resource Errors

Errors set on a Payoff's `error` property for processes that are unsuccessful.

### `18001 – PAYOFF_TEMPORARILY_UNAVAILABLE`

There was an issue with connecting with the Account's Financial Institution and the request could not be completed.

```json
{
  "type": "PAYOFF_FAILED",
  "code": 18001,
  "sub_type": "PAYOFF_TEMPORARILY_UNAVAILABLE",
  "message": "Payoff is temporarily unavailable for this account."
}
```

***


# Product Errors



## Status Errors

Product's status represents the current access state of the Product. The following errors are related to the status of the Product.

### `ACCOUNT_CONSENT_UNAVAILABLE`

Account consent for your organization is unavailable.

### `ENTITY_IDENTITY_VERIFICATION_MISSING`

Entity's identity must be verified before they can access the requested Product.

### `PRODUCT_RESTRICTED`

This Product is currently not available for this Entity or Account due to missing information or verification. Please update your information to gain access to this Product.

### `PRODUCT_UNAVAILABLE`

This Product is not supported for this Entity or Account.

### `PRODUCT_VERIFICATION_MISSING`

Account is missing verification for the Product.

### `TEAM_CAPABILITY_RESTRICTED`

Your organization does not have access to this Product.

***


# Request Errors



export const ParamList = ({items, is_child = false}) => {
  return items.map(item => {
    const field_props = {
      id: Math.random().toString(),
      body: item.name,
      name: item.name,
      type: item.type,
      required: item.required
    };
    const enums = item.enums || [];
    const items = item.items || [];
    const has_items = items?.length > 0;
    const has_enums = enums?.length > 0;
    const should_default_open = item.defaultOpen | false;
    const render_child_item = () => {
      const child_props = {
        title: has_enums ? "Possible enum values" : "properties"
      };
      if (should_default_open) child_props.defaultOpen = true;
      const has_inline_enums = has_enums && enums.every(enum_item => typeof enum_item === 'string') && enums.map((enum_item, idx) => {
        const is_last = idx === enums.length - 1;
        const is_2nd_to_last = idx === enums.length - 2;
        return <>
            <code>{enum_item}</code>
            {is_last && ''}
            {is_2nd_to_last && ' or '}
            {!is_last && !is_2nd_to_last && ', '}
          </>;
      });
      const enum_list = has_enums && !has_inline_enums && <Accordion {...child_props}>
          {enums.map(enum_item => <>
              <code>{enum_item.name}</code>
              <br />
              <p>{enum_item.description}</p>
            </>)}
        </Accordion>;
      const item_list = has_items && <Expandable {...child_props}>
          <ParamList items={items || []} is_child />
        </Expandable>;
      return <>
          <p>
            {item.description}
            {has_inline_enums && [has_inline_enums.length > 1 ? ' One of ' : ' Must be ', ...has_inline_enums]}
          </p>

          {enum_list}
          {item_list}
        </>;
    };
    return is_child ? <ResponseField {...field_props}>{render_child_item()}</ResponseField> : <ParamField {...field_props}>{render_child_item()}</ParamField>;
  });
};

Method uses conventional HTTP response codes to indicate the success or failure of an API request.
In general: Codes in the `2xx` range indicate success. Codes in the `4xx` range indicate an error occurred
with the information provided (e.g., a required parameter was omitted, a resource was not found, etc.).
Codes in the `5xx` range indicate an error occurred within Method's servers.

## Attributes

<ParamList
  items={[
  {
    name: "error",
    type: "object",
    description: "Unique identifier for the Error.",
    defaultOpen: true,
    items: [

      {
        name: "error.type",
        type: "enum",
        description: (
          <>
            The type of error returned. Possible enums are{" "}
            <code>INVALID_AUTHORIZATION</code>, <code>INVALID_REQUEST</code>,
            or <code>API_ERROR</code>.
          </>
        ),
      },
      {
        name: "error.code",
        type: "number",
        description:
          "The HTTP error code. This is the same as the status code.",
      },
      {
        name: "error.sub_type",
        type: "string",
        description:
          "This field gives more unique types that will be used to identify the error.",
      },
      {
        name: "error.message",
        type: "string",
        description:
          "A human-readable message providing more details about the error.",
      },
    ],
  },
  ]}
/>

#### HTTP STATUS CODE SUMMARY

| code  | function            | Description                                                                                      |
| ----- | ------------------- | ------------------------------------------------------------------------------------------------ |
| `200` | `OK`                | Everything worked as expected.                                                                   |
| `400` | `Bad Request`       | The request was unacceptable, often due to missing a required parameter.                         |
| `401` | `Unauthorized`      | No valid API key provided.                                                                       |
| `403` | `Forbidden`         | The API key doesn't have permissions to perform the request.                                     |
| `404` | `Not Found`         | The requested resource doesn't exist.                                                            |
| `429` | `Too Many Requests` | Too many requests hit the API too quickly. We recommend an exponential backoff of your requests. |
| `500` | `Server Errors`     | Something went wrong on Method's end.                                                            |

<RequestExample>
  ```javascript THE ERROR OBJECT
  {
    "type": "INVALID_REQUEST",
    "code": 400,
    "sub_type": "INVALID_SOURCE_LIABILITY",
    "message": "Invalid source account received. Only ACH accounts can be used as a source."
  }
  ```
</RequestExample>

<ResponseExample>
  ```json
  {
    "success": false,
    "data": {
      "error": {
        "type": "INVALID_REQUEST",
        "code": 400,
        "sub_type": "INVALID_SOURCE_LIABILITY",
        "message": "Invalid source account received. Only ACH accounts can be used as a source."
      }
    },
    "message": "Invalid source account received. Only ACH accounts can be used as a source."
  }
  ```
</ResponseExample>


# Resource Errors



These types of errors occur after a resource has been created. The information
regarding these errors are provided in the resource object's `error` property.

### Error Codes

A resource error's `code` is unique across all resources. This code specifically indicates
exactly what error occurred for what type of resource. Here is how the error codes
are partitioned for each resource:

| Code Range | Resource                                                                                             |
| ---------- | ---------------------------------------------------------------------------------------------------- |
| `10XXX`    | [Payments](/reference/errors/payment-errors#resource-errors)                                         |
| `11XXX`    | [Accounts](/reference/errors/account-errors#resource-errors)                                         |
| `12XXX`    | [Entities](/reference/errors/entity-errors#resource-errors)                                          |
| `14XXX`    | [PaymentReversals](/reference/errors/payment-reversal-errors#resource-errors)                        |
| `16XXX`    | [AccountVerificationSessions](/reference/errors/account-verification-session-errors#resource-errors) |
| `17XXX`    | [Sensitive](/reference/errors/sensitive-errors#resource-errors)                                      |
| `18XXX`    | [Payoffs](/reference/errors/payoff-errors#resource-errors)                                           |
| `19XXX`    | [EntityVerificationSessions](/reference/errors/entity-verification-session-errors#resource-errors)   |
| `20XXX`    | [Balances](/reference/errors/balance-errors#resource-errors)                                         |
| `21XXX`    | [Updates](/reference/errors/update-errors#resource-errors)                                           |
| `23XXX`    | [CreditScores](/reference/errors/credit-score-errors#resource-errors)                                |
| `25XXX`    | [Webhooks](/reference/errors/webhook-errors#resource-errors)                                         |

<RequestExample>
  ```json ERROR OBJECT
  {
    "type": "PAYMENT_FAILED",
    "code": 10001,
    "sub_type": "PAYMENT_INSUFFICIENT_FUNDS",
    "message": "Source account has insufficient funds."
  }
  ```
</RequestExample>

<ResponseExample>
  ```json ERROR ON RESOURCE
  {
    "id": "pmt_rPrDPEwyCVUcm",
    "reversal_id": null,
    "source_trace_id": null,
    "destination_trace_id": null,
    "source": "acc_JMJZT6r7iHi8e",
    "destination": "acc_AXthnzpBnxxWP",
    "amount": 5000,
    "description": "Loan Pmt",
    "status": "failed",
    "error": {
      "type": "PAYMENT_FAILED",
      "code": 10001,
      "sub_type": "PAYMENT_INSUFFICIENT_FUNDS",
      "message": "Source account has insufficient funds."
    },
    "metadata": null,
    "estimated_completion_date": "2020-12-11",
    "source_settlement_date": "2020-12-09",
    "destination_settlement_date": "2020-12-11",
    "fee": null,
    "created_at": "2020-12-09T00:42:31.209Z",
    "updated_at": "2020-12-09T00:43:30.996Z"
  }
  ```
</ResponseExample>


# Sensitive Errors



## Request Errors

The request to the `/accounts/:acc_id/sensitive` endpoint failed. These are the `sub_type` that can be returned.

### `INVALID_REQUEST`

The request body failed basic validation for the specific API endpoint.

### `NOT_FOUND`

The requested resource does not exist.

### `PRODUCT_UNAVAILABLE`

This Account does not support retrieving Account's sensitive information.

### `TEAM_CAPABILITY_RESTRICTED`

Your organization does not have access to Sensitive endpoint.

### `PRODUCT_VERIFICATION_MISSING`

Account must be verified before it can access `/accounts/:acc_id/sensitive` endpoint.

***

## Resource Errors

Errors set on a Sensitive's `error` property for processes that are unsuccessful.

### `17001 – SENSITIVE_FAILED_VERIFICATION_REQUIRED`

Invalid information was passed in when making the request to retrieve the Account's sensitive information.
Validate the request and try again.

```json
{
  "type": "SENSITIVE_FAILED",
  "code": 17001,
  "sub_type": "SENSITIVE_FAILED_VERIFICATION_REQUIRED",
  "message": "Sensitive failed due to missing required verification."
}
```

***


# Subscription Errors



## Request Errors

Subscriptions will always return a 200 when making a `POST`.
The response will contain a map of Subscription name to either Subscription object or Error.

### `PRODUCT_CAPABILITY_RESTRICTED`

The status of the Product that this Subscription is associated with is restricted to this Entity or Account.

### `PRODUCT_UNAVAILABLE`

The status of the Product that this Subscription is associated with is unavailable to this Entity or Account.

### `SUBSCRIPTION_DUPLICATE`

There was an attempt to enroll in an already active Subscription

### `SUBSCRIPTION_NOT_FOUND`

The Subscription that was attempted to enroll in does not exist.

### `TEAM_CAPABILITY_RESTRICTED`

Your organization does not have access to this Subscription.

***


# Update Errors



## Request Errors

The request to the `/accounts/:acc_id/updates` endpoint failed. These are the `sub_type` that can be returned.

### `INVALID_REQUEST`

The request body failed basic validation for the specific API endpoint.

### `NOT_FOUND`

The requested resource does not exist.

### `PRODUCT_UNAVAILABLE`

This Account does not support Update. This could be due to the Account's status
or Method currently doesn't support Updates for the Account's Financial Institution.

### `TEAM_CAPABILITY_RESTRICTED`

Your organization does not have access to Update endpoint.

### `PRODUCT_VERIFICATION_MISSING`

Account must be verified before it can access `/accounts/:acc_id/updates` endpoint.

***

## Resource Errors

Errors set on a Update's `error` property for processes that are unsuccessful.

### `21001 – UPDATE_TEMPORARILY_UNAVAILABLE`

There was an issue with connecting with the Account's Financial Institution and the request could not be completed.

```json
{
  "type": "UPDATE_FAILED",
  "code": 21001,
  "sub_type": "UPDATE_TEMPORARILY_UNAVAILABLE",
  "message": "Update is temporarily unavailable for this account."
}
```

***


# Webhook Errors



## Request Errors

The request to the `/webhooks/:webhook_id` endpoint failed. These are the `sub_type` that can be returned.

### `INVALID_REQUEST`

The request body failed basic validation for the specific API endpoint.

### `NOT_FOUND`

The requested resource does not exist.

***

## Resource Errors

Errors set on a webhook's `error` property for processes that are unsuccessful.

### `25001 – WEBHOOK_DISABLED_FAILED_OTHER`

There were 5 consecutive failures when posting to the webhook url provided where error was not a 4XX, 5XX error, or a timeout.

#### Causes

*   This could happen for a variety of reason types, please reach out to the team for more specific information.

```json
{
  "type": "WEBHOOK_DISABLED",
  "code": 25001,
  "sub_type": "WEBHOOK_DISABLED_FAILED_OTHER",
  "message": "Webhook automatically disabled after failing 5 times to connect. Error was not 4XX or 5XX type."
}
```

#### Resolution

The webhook will be disabled and will not proceed in posting again to the provided url.

### `25002 – WEBHOOK_DISABLED_RECEIVED_4XX_ERROR`

The webhook specifically received 4XX type errors when posting.

#### Causes

*   Invalid resource URL
*   Permission denied
*   Forbidden

```json
{
  "type": "WEBHOOK_DISABLED",
  "code": 25002,
  "sub_type": "WEBHOOK_DISABLED_RECEIVED_4XX_ERROR",
  "message": "Webhook failed 5 times with a client error (4XX type)."
}
```

#### Resolution

The webhook will be disabled and will not proceed in posting again to the provided url.

***

### `25003 – WEBHOOK_DISABLED_RECEIVED_5XX_ERROR`

The webhook specifically received 5XX type errors when posting.

#### Causes

*   Internal server error (from webhook url)
*   Not implemented
*   Bad Gateway
*   Server unavailable
*   Gateway timeout

```json
{
  "type": "WEBHOOK_DISABLED",
  "code": 25003,
  "sub_type": "WEBHOOK_DISABLED_RECEIVED_5XX_ERROR",
  "message": "Webhook failed 5 times with a server error (5XX)."
}
```

#### Resolution

The webhook will be disabled and will not proceed in posting again to the provided url.

***

### `25004 – WEBHOOK_DISABLED_TIMEOUT_ON_RESPONSE`

When posting a information to a webhook url, our API did not receive a valid response in the 5 second period.

#### Causes

The timeout could happen for a variety of reasons:

*   Bad network or firewall config
*   Long processing time on webhook receiver side

```json
{
  "type": "WEBHOOK_DISABLED",
  "code": 25004,
  "sub_type": "WEBHOOK_DISABLED_TIMEOUT_ON_RESPONSE",
  "message": "Webhook failed 5 times in receiving a response back from the webhook url provided. Expected response time is 5 seconds."
}
```

#### Resolution

The webhook will be disabled and will not proceed in posting again to the provided url.

If you've timed out check network configs allow method servers to hit it.

Also confirm that after a payload has been posted to the webhook receiving url that successful responses are able to respond back in under 5 seconds. Typically this can be achieved by queuing the webhook data on your side and then immediately sending a 200 response back, then processing the webhook information asynchronously.

***


# List all Events

GET /events

export const get_pagination_defaults = (resource_name = 'records') => [{
  name: 'from_date',
  type: 'string',
  required: false,
  description: `ISO 8601 formatted date (YYYY-MM-DD) to filter for ${resource_name} created on and after the date provided.`
}, {
  name: 'to_date',
  type: 'string',
  required: false,
  description: `ISO 8601 formatted date (YYYY-MM-DD) to filter for ${resource_name} created on and before the date provided.`
}, {
  name: 'page',
  type: 'string',
  required: false,
  description: `The number of the page to return.`
}, {
  name: 'page_cursor',
  type: 'string',
  required: false,
  description: <>
        The ID of a resource from which a page should start or end. Mutually exclusive with <code>page</code>.
      </>
}, {
  name: 'page_limit',
  type: 'string',
  required: false,
  description: `The number of ${resource_name} to return per page.`
}];

export const ParamList = ({items, is_child = false}) => {
  return items.map(item => {
    const field_props = {
      id: Math.random().toString(),
      body: item.name,
      name: item.name,
      type: item.type,
      required: item.required
    };
    const enums = item.enums || [];
    const items = item.items || [];
    const has_items = items?.length > 0;
    const has_enums = enums?.length > 0;
    const should_default_open = item.defaultOpen | false;
    const render_child_item = () => {
      const child_props = {
        title: has_enums ? "Possible enum values" : "properties"
      };
      if (should_default_open) child_props.defaultOpen = true;
      const has_inline_enums = has_enums && enums.every(enum_item => typeof enum_item === 'string') && enums.map((enum_item, idx) => {
        const is_last = idx === enums.length - 1;
        const is_2nd_to_last = idx === enums.length - 2;
        return <>
            <code>{enum_item}</code>
            {is_last && ''}
            {is_2nd_to_last && ' or '}
            {!is_last && !is_2nd_to_last && ', '}
          </>;
      });
      const enum_list = has_enums && !has_inline_enums && <Accordion {...child_props}>
          {enums.map(enum_item => <>
              <code>{enum_item.name}</code>
              <br />
              <p>{enum_item.description}</p>
            </>)}
        </Accordion>;
      const item_list = has_items && <Expandable {...child_props}>
          <ParamList items={items || []} is_child />
        </Expandable>;
      return <>
          <p>
            {item.description}
            {has_inline_enums && [has_inline_enums.length > 1 ? ' One of ' : ' Must be ', ...has_inline_enums]}
          </p>

          {enum_list}
          {item_list}
        </>;
    };
    return is_child ? <ResponseField {...field_props}>{render_child_item()}</ResponseField> : <ParamField {...field_props}>{render_child_item()}</ParamField>;
  });
};

Returns a list of Events that satisfy the provided filters.

## Query Parameters

<ParamList
  items={[
  {
  name: 'resource_id',
  type: 'string',
  required: false,
  description: 'Filter events by the associated resource ID.',
  },
  {
  name: 'resource_type',
  type: 'enum',
  required: false,
  description: 'Filter events by the type of resource.',
  enums: ['payment', 'entity', 'account', 'credit_score'],
  },
  {
  name: 'type',
  type: 'string',
  required: false,
  description: 'Filter events by the event type (e.g., payment.update, credit_score.increased).',
  },
  ...get_pagination_defaults('Events'),
  ]}
/>

## Returns

Returns a paginated list of Event objects.

<RequestExample>
  ```bash cURL
  curl "https://production.methodfi.com/events?resource_id=pmt_zR3nJG3c99P3X" \
    -H "Method-Version: 2024-04-04" \
    -H "Authorization: Bearer sk_WyZEWVfTcH7GqmPzUPk65Vjc"
  ```

  ```javascript Node.js
  const events = await method.events.list({
    resource_id: 'pmt_zR3nJG3c99P3X',
    type: 'payment.update'
  });
  ```

  ```python Python
  events = method.events.list({
    'resource_id': 'pmt_zR3nJG3c99P3X',
    'type': 'payment.update'
  })
  ```
</RequestExample>

<ResponseExample>
  ```json
  {
    "data": [
      {
        "id": "evt_7pPmytbXgWk7C",
        "type": "credit_score.increased",
        "resource_id": "crs_wXVk4MM7QWNnh",
        "resource_type": "credit_score",
        "data": "CreditScore",
        "diff": {
          "before": {
            "id": "crs_pn4ca33GXFaCE",
            "entity_id": "ent_au22b1fbFJbp8",
            "status": "completed",
            "scores": [
              {
                "score": 724,
                "source": "equifax",
                "model": "vantage_3",
                "factors": []
              }
            ]
          },
          "after": {
            "id": "crs_wXVk4MM7QWNnh",
            "entity_id": "ent_au22b1fbFJbp8",
            "status": "completed", 
            "scores": [
              {
                "score": 741,
                "source": "equifax",
                "model": "vantage_3",
                "factors": []
              }
            ]
          }
        },
        "updated_at": "2024-08-01T16:08:25.462Z",
        "created_at": "2024-08-01T16:08:25.462Z"
      },
      ...
    ],
  }
  ```
</ResponseExample>


# The event endpoint



export const ParamList = ({items, is_child = false}) => {
  return items.map(item => {
    const field_props = {
      id: Math.random().toString(),
      body: item.name,
      name: item.name,
      type: item.type,
      required: item.required
    };
    const enums = item.enums || [];
    const items = item.items || [];
    const has_items = items?.length > 0;
    const has_enums = enums?.length > 0;
    const should_default_open = item.defaultOpen | false;
    const render_child_item = () => {
      const child_props = {
        title: has_enums ? "Possible enum values" : "properties"
      };
      if (should_default_open) child_props.defaultOpen = true;
      const has_inline_enums = has_enums && enums.every(enum_item => typeof enum_item === 'string') && enums.map((enum_item, idx) => {
        const is_last = idx === enums.length - 1;
        const is_2nd_to_last = idx === enums.length - 2;
        return <>
            <code>{enum_item}</code>
            {is_last && ''}
            {is_2nd_to_last && ' or '}
            {!is_last && !is_2nd_to_last && ', '}
          </>;
      });
      const enum_list = has_enums && !has_inline_enums && <Accordion {...child_props}>
          {enums.map(enum_item => <>
              <code>{enum_item.name}</code>
              <br />
              <p>{enum_item.description}</p>
            </>)}
        </Accordion>;
      const item_list = has_items && <Expandable {...child_props}>
          <ParamList items={items || []} is_child />
        </Expandable>;
      return <>
          <p>
            {item.description}
            {has_inline_enums && [has_inline_enums.length > 1 ? ' One of ' : ' Must be ', ...has_inline_enums]}
          </p>

          {enum_list}
          {item_list}
        </>;
    };
    return is_child ? <ResponseField {...field_props}>{render_child_item()}</ResponseField> : <ParamField {...field_props}>{render_child_item()}</ParamField>;
  });
};

The Events API allows you to track both literal and computed changes to various Method resources, such as Entities, Accounts, Payments, and more. Events provide detailed insights into how data changes over time, helping teams monitor resource updates and interpret complex changes.

Literal events track specific updates to a resource. For example, if a payment's status transitions from `pending` to `processing`, a `payment.update` event will be triggered, showing the exact change.

Computed events are triggered when a meaningful interpretation is derived by comparing changes across multiple resources or combining several field changes. For example, the `credit_score.increased` event is triggered when a new credit score record shows an increase compared to the previous record.

## Event Objects

<ParamList
  items={[
  {
  name: 'id',
  type: 'string',
  description: 'Unique identifier for the Event.',
  },
  {
  name: 'type',
  type: 'enum',
  description: 'Type of event.',
  items: [
    {
      name: 'account.opened',
      description: 'An Account has been opened.',
    },
    {
      name: 'account.closed',
      description: 'An Account has been closed.',
    },
    {
      name: 'credit_score.increased',
      description: 'A user\'s credit score has increased.',
    },
    {
      name: 'credit_score.decreased',
      description: 'A user\'s credit score has decreased.',
    },
    {
      name: 'attribute.credit_health_credit_card_usage.increased',
      description: 'Credit card usage has increased.',
    },
    {
      name: 'attribute.credit_health_credit_card_usage.decreased',
      description: 'Credit card usage has decreased.',
    },
    {
      name: 'attribute.credit_health_derogatory_marks.increased',
      description: 'Number of derogatory marks increased.',
    },
    {
      name: 'attribute.credit_health_derogatory_marks.decreased',
      description: 'Number of derogatory marks decreased.',
    },
    {
      name: 'attribute.credit_health_hard_inquiries.increased',
      description: 'Number of hard inquiries increased.',
    },
    {
      name: 'attribute.credit_health_hard_inquiries.decreased',
      description: 'Number of hard inquiries decreased.',
    },
    {
      name: 'attribute.credit_health_total_accounts.increased',
      description: 'Total number of accounts increased.',
    },
    {
      name: 'attribute.credit_health_total_accounts.decreased',
      description: 'Total number of accounts decreased.',
    },
    {
      name: 'attribute.credit_health_credit_age.increased',
      description: 'Credit age has increased.',
    },
    {
      name: 'attribute.credit_health_credit_age.decreased',
      description: 'Credit age has decreased.',
    },
    {
      name: 'attribute.credit_health_payment_history.increased',
      description: 'Payment history score has improved.',
    },
    {
      name: 'attribute.credit_health_payment_history.decreased',
      description: 'Payment history score has decreased.',
    },
  ]
  },
  {
  name: 'resource_id',
  type: 'string',
  description: 'ID of the resource associated with the event.',
  },
  {
  name: 'resource_type',
  type: 'enum',
  description: 'Type of resource',
  enums: ['account', 'attribute', 'connect', 'credit_score'],
  },
  {
  name: 'data',
  type: 'object',
  description: 'A snapshot of the associated resource.',
  },
  {
  name: 'diff',
  type: 'object',
  description: 'An object representing the differences/changes that occurred.',
  items: [
    {
      name: 'diff.before',
      type: 'object|null',
      description: 'The state before the change occurred.',
    },
    {
      name: 'diff.after',
      type: 'object|null',
      description: 'The state after the change occurred.',
    }
  ]
  },
  {
  name: 'created_at',
  type: 'string',
  description: 'Timestamp when the event was created.',
  },
  {
  name: 'updated_at',
  type: 'string',
  description: 'Timestamp when the event was last updated.',
  }
  ]}
/>

<RequestExample>
  ```json THE EVENT OBJECT
  {
    "id": "evt_7pPmytbXgWk7C",
    "type": "credit_score.increased",
    "resource_id": "crs_wXVk4MM7QWNnh",
    "resource_type": "credit_score",
    "data": "CreditScore",
    "diff": {
      "before": {
        "id": "crs_pn4ca33GXFaCE",
        "entity_id": "ent_au22b1fbFJbp8",
        "status": "completed",
        "scores": [
          {
            "score": 724,
            "source": "equifax",
            "model": "vantage_3",
            "factors": []
          }
        ]
      },
      "after": {
        "id": "crs_wXVk4MM7QWNnh",
        "entity_id": "ent_au22b1fbFJbp8",
        "status": "completed", 
        "scores": [
          {
            "score": 741,
            "source": "equifax",
            "model": "vantage_3",
            "factors": []
          }
        ]
      }
    },
    "updated_at": "2024-08-01T16:08:25.462Z",
    "created_at": "2024-08-01T16:08:25.462Z"
  }
  ```
</RequestExample>


# Retrieve an Event

GET /events/{evt_id}

export const ParamList = ({items, is_child = false}) => {
  return items.map(item => {
    const field_props = {
      id: Math.random().toString(),
      body: item.name,
      name: item.name,
      type: item.type,
      required: item.required
    };
    const enums = item.enums || [];
    const items = item.items || [];
    const has_items = items?.length > 0;
    const has_enums = enums?.length > 0;
    const should_default_open = item.defaultOpen | false;
    const render_child_item = () => {
      const child_props = {
        title: has_enums ? "Possible enum values" : "properties"
      };
      if (should_default_open) child_props.defaultOpen = true;
      const has_inline_enums = has_enums && enums.every(enum_item => typeof enum_item === 'string') && enums.map((enum_item, idx) => {
        const is_last = idx === enums.length - 1;
        const is_2nd_to_last = idx === enums.length - 2;
        return <>
            <code>{enum_item}</code>
            {is_last && ''}
            {is_2nd_to_last && ' or '}
            {!is_last && !is_2nd_to_last && ', '}
          </>;
      });
      const enum_list = has_enums && !has_inline_enums && <Accordion {...child_props}>
          {enums.map(enum_item => <>
              <code>{enum_item.name}</code>
              <br />
              <p>{enum_item.description}</p>
            </>)}
        </Accordion>;
      const item_list = has_items && <Expandable {...child_props}>
          <ParamList items={items || []} is_child />
        </Expandable>;
      return <>
          <p>
            {item.description}
            {has_inline_enums && [has_inline_enums.length > 1 ? ' One of ' : ' Must be ', ...has_inline_enums]}
          </p>

          {enum_list}
          {item_list}
        </>;
    };
    return is_child ? <ResponseField {...field_props}>{render_child_item()}</ResponseField> : <ParamField {...field_props}>{render_child_item()}</ParamField>;
  });
};

Returns the Event object associated with the ID.

## Path Parameters

<ParamList
  items={[
  {
  name: 'evt_id',
  type: 'string',
  required: true,
  description: 'ID of the Event',
  },
  ]}
/>

## Returns

Returns the Event object associated with the ID.

<RequestExample>
  ```bash cURL
  curl https://production.methodfi.com/events/evt_knqJgxKUnqDVJ \
    -H "Method-Version: 2024-04-04" \
    -H "Authorization: Bearer sk_WyZEWVfTcH7GqmPzUPk65Vjc"
  ```

  ```javascript Node.js
  const event = await method.events.retrieve('evt_knqJgxKUnqDVJ');
  ```

  ```python Python
  event = method.events.retrieve('evt_knqJgxKUnqDVJ')
  ```
</RequestExample>

<ResponseExample>
  ```json
  {
    "id": "evt_7pPmytbXgWk7C",
    "type": "credit_score.increased",
    "resource_id": "crs_wXVk4MM7QWNnh",
    "resource_type": "credit_score",
    "data": "CreditScore",
    "diff": {
      "before": {
        "id": "crs_pn4ca33GXFaCE",
        "entity_id": "ent_au22b1fbFJbp8",
        "status": "completed",
        "scores": [
          {
            "score": 724,
            "source": "equifax",
            "model": "vantage_3",
            "factors": []
          }
        ]
      },
      "after": {
        "id": "crs_wXVk4MM7QWNnh",
        "entity_id": "ent_au22b1fbFJbp8",
        "status": "completed", 
        "scores": [
          {
            "score": 741,
            "source": "equifax",
            "model": "vantage_3",
            "factors": []
          }
        ]
      }
    },
    "updated_at": "2024-08-01T16:08:25.462Z",
    "created_at": "2024-08-01T16:08:25.462Z"
  }
  ```
</ResponseExample>


# Expanding Resources



export const ExpandableFieldsQueryParams = (resource_type = 'all') => {
  const entity = [{
    name: 'connect',
    description: <>This is an <a href="/reference/entities/overview">Entity</a> property, and refers to the <a href="/reference/entities/connect/overview#connect-objects">Connect Object</a>.</>
  }, {
    name: 'credit_score',
    description: <>This is an <a href="/reference/entities/overview">Entity</a> property, and refers to the <a href="/reference/entities/credit-scores/overview#creditscore-objects">CreditScore Object</a>.</>
  }, {
    name: 'attribute',
    description: <>This is an <a href="/reference/entities/overview">Entity</a> property, and refers to the <a href="/reference/entities/attributes/overview#attribute-objects">Attribute Object</a>.</>
  }, {
    name: 'identity_latest_verification_session',
    description: <>This is an <a href="/reference/entities/overview">Entity</a> property, and refers to the <a href="/reference/entities/verification-sessions/overview#entity-verification-session-objects">EntityVerificationSession Object</a>.</>
  }, {
    name: 'phone_latest_verification_session',
    description: <>This is an <a href="/reference/entities/overview">Entity</a> property, and refers to the <a href="/reference/entities/verification-sessions/overview#entity-verification-session-objects">EntityVerificationSession Object</a>.</>
  }];
  const account = [{
    name: 'sensitive',
    description: <>This is an <a href="/reference/accounts/overview">Account</a> property, and refers to the <a href="/reference/accounts/sensitive/overview#sensitive-objects">Sensitive Object</a>.</>
  }, {
    name: 'balance',
    description: <>This is an <a href="/reference/accounts/overview">Account</a> property, and refers to the <a href="/reference/accounts/balances/overview#balances-objects">Balance Object</a>.</>
  }, {
    name: 'card_brand',
    description: <>This is an <a href="/reference/accounts/overview">Account</a> property, and refers to the <a href="/reference/accounts/card-brands/overview#cardbrand-objects">CardBrand Object</a>.</>
  }, {
    name: 'payoff',
    description: <>This is an <a href="/reference/accounts/overview">Account</a> property, and refers to the <a href="/reference/accounts/payoffs/overview#payoff-objects">Payoff Object</a>.</>
  }, {
    name: 'transactions',
    description: <>This is an <a href="/reference/accounts/overview">Account</a> property, and refers to the <a href="/reference/accounts/transactions/overview#transaction-objects">Transaction Object</a>.</>
  }, {
    name: 'update',
    description: <>This is an <a href="/reference/accounts/overview">Account</a> property, and refers to the <a href="/reference/accounts/updates/overview#update-objects">Update Object</a>.</>
  }, {
    name: 'latest_verification_session',
    description: <>This is an <a href="/reference/accounts/overview">Account</a> property, and refers to the <a href="/reference/accounts/verification-sessions/overview#accountverificationsession-objects">AccountVerificationSession Object</a>.</>
  }];
  const ExpandableFieldsByResourceType = {
    entity,
    account,
    all: Array.from(new Set([...entity, ...account]))
  };
  return {
    name: "expand",
    type: "enum[]",
    description: <>
        Attributes that can be expanded into an object to
        provide additional information.
      </>,
    enums: [...ExpandableFieldsByResourceType[resource_type].map(expandable_field => ({
      ...expandable_field
    }))]
  };
};

export const ParamList = ({items, is_child = false}) => {
  return items.map(item => {
    const field_props = {
      id: Math.random().toString(),
      body: item.name,
      name: item.name,
      type: item.type,
      required: item.required
    };
    const enums = item.enums || [];
    const items = item.items || [];
    const has_items = items?.length > 0;
    const has_enums = enums?.length > 0;
    const should_default_open = item.defaultOpen | false;
    const render_child_item = () => {
      const child_props = {
        title: has_enums ? "Possible enum values" : "properties"
      };
      if (should_default_open) child_props.defaultOpen = true;
      const has_inline_enums = has_enums && enums.every(enum_item => typeof enum_item === 'string') && enums.map((enum_item, idx) => {
        const is_last = idx === enums.length - 1;
        const is_2nd_to_last = idx === enums.length - 2;
        return <>
            <code>{enum_item}</code>
            {is_last && ''}
            {is_2nd_to_last && ' or '}
            {!is_last && !is_2nd_to_last && ', '}
          </>;
      });
      const enum_list = has_enums && !has_inline_enums && <Accordion {...child_props}>
          {enums.map(enum_item => <>
              <code>{enum_item.name}</code>
              <br />
              <p>{enum_item.description}</p>
            </>)}
        </Accordion>;
      const item_list = has_items && <Expandable {...child_props}>
          <ParamList items={items || []} is_child />
        </Expandable>;
      return <>
          <p>
            {item.description}
            {has_inline_enums && [has_inline_enums.length > 1 ? ' One of ' : ' Must be ', ...has_inline_enums]}
          </p>

          {enum_list}
          {item_list}
        </>;
    };
    return is_child ? <ResponseField {...field_props}>{render_child_item()}</ResponseField> : <ParamField {...field_props}>{render_child_item()}</ParamField>;
  });
};

Many objects allow you to request additional information as an expanded response by using the expand query parameter.
This parameter is available for `entities` and `accounts`, and applies to the response of that request only.

In many cases, an object contains the ID of a related object in its response attributes. For example, an `Entity` might have an associated `CreditScore` ID.
You can expand these objects in line with the expand query parameter. The expandable label in this documentation indicates ID fields that you can expand into objects.

You can expand multiple objects at the same time by identifying multiple items in the expand array. Performing expansions on list requests might result in increased response times.

## Props

<ParamList
  items={[
  ExpandableFieldsQueryParams(),
  ]}
/>

## Returns

Returns a list of the requested resource with the requested attributes expanded.

<RequestExample>
  ```bash cURL
  curl "https://production.methodfi.com/entities/ent_BzirqpLEm3BW7?expand[]=connect" \
    -H "Authorization: Bearer sk_WyZEWVfTcH7GqmPzUPk65Vjc"
  ```

  ```javascript Node.js
  const payments = await method
    .entities
    .retrieve("ent_BzirqpLEm3BW7", {
      expand: ["connect"],
    });
  ```

  ```python Python
  payments = method
    .entities
    .retrieve('ent_BzirqpLEm3BW7', {
      'expand': ['connect'],
    })
  ```
</RequestExample>

<ResponseExample>
  ```json
    {
      "id": "ent_BzirqpLEm3BW7",
      "type": "individual",
      "individual": {
        "first_name": "Kevin",
        "last_name": "Doyle",
        "phone": "+15121231113",
        "dob": "1997-03-18",
        "email": "kevin.doyle@gmail.com",
        "ssn_4": null,
        "ssn": null
      },
      "error": null,
      "address": {
        "line1": "3300 N Interstate 35",
        "line2": null,
        "city": "Austin",
        "state": "TX",
        "zip": "78705"
      },
      "status": "active",
      "verification": {
        "identity": {
          "verified": true,
          "matched": true,
          "latest_verification_session": "evf_mQ6yr6VVJLNEb",
          "methods": []
        },
        "phone": {
          "verified": true,
          "latest_verification_session": "evf_P4QXNj93Y9J8L",
          "methods": []
        }
      },
      "connect": {
        "id": "cxn_4ewMmBbjYDMR4",
        "entity_id": "ent_qKNBB68bfHGNA",
        "status": "completed",
        "accounts": [
          "acc_eKKmrXDpJBKgw",
          "acc_GV8WbmJW7KGRy",
          "acc_MLPKh9gQDDbT8",
          "acc_LbXE8wVYJLrKt",
          "acc_J3P9fayDFjpAy",
          "acc_eFFRV9zmpLREK"
        ],
        "error": null,
        "created_at": "2024-04-12T14:56:46.645Z",
        "updated_at": "2024-04-12T14:56:46.786Z"
      },
      "credit_score": "crs_pn4ca33GXFaCE",
      "identity": null,
      "products": [
        "connect",
        "credit_score"
      ],
      "restricted_products": [
        "identity", "attribute"
      ],
      "subscriptions": [],
      "available_subscriptions": [],
      "restricted_subscriptions": [
        "connect",
        "credit_score"
      ],
      "metadata": null,
      "created_at": "2024-04-12T14:56:34.710Z",
      "updated_at": "2024-04-12T14:56:34.744Z"

  }
  ```
</ResponseExample>


# Perform a Health Check

GET /ping

A health check may be performed by calling the `/ping` endpoint.

<RequestExample>
  ```bash cURL
  curl https://production.methodfi.com/ping \
    -H "Method-Version: 2024-04-04" \
    -H "Authorization: Bearer sk_WyZEWVfTcH7GqmPzUPk65Vjc"
  ```

  ```javascript Node.js
  await method.ping();
  ```

  ```python Python
  method.ping()
  ```
</RequestExample>

<ResponseExample>
  ```json
  {
    "success": true,
    "data": null,
    "message": "pong"
  }
  ```
</ResponseExample>


# Idempotency



Method's API supports idempotency for safely retrying requests without accidentally performing the
same operation twice. This helps avoid unwanted duplication in case of failures and retries. For
example, in the case of a timeout error, it is possible to safely retry sending the same API payment
call multiple times with the guarantee that the payment will only be created once.

Method's idempotency works by saving the resulting status code and body of the first request
made for any given idempotency key, regardless of whether it succeeded or failed. Subsequent
requests with the same key return the same result, including `500` errors.

#### Enable idempotency

To submit a request for idempotent processing, send a request with
the `Idempotency-Key: <key>` header. The `<key>` can be any unique string
up to 255 characters long. (We recommend using V4 UUIDs). All `POST` requests accept
idempotency keys.

#### Idempotency error

In the unlikely event that the idempotent data store is unavailable, the API returns
a `503` error status with the a sub type of `IDEMPOTENCY_UNAVAILABLE` If idempotency
is required, we recommend retrying your request later, otherwise, fall back to non-idempotent processing by
not submitting the `Idempotency-Key` header.

<RequestExample>
  ```bash cURL
  curl https://production.methodfi.com/payments \
    -X POST \
    -H "Method-Version: 2024-04-04" \
    -H "Authorization: Bearer sk_WyZEWVfTcH7GqmPzUPk65Vjc" \
    -H "Idempotency-Key: 24c47283-0cc8-43a0-8b4a-ce16d002de97" \
    -H "Content-Type: application/json" \
    -d '{
      "amount": 5000,
      "source": "acc_JMJZT6r7iHi8e",
      "destination": "acc_AXthnzpBnxxWP",
      "description": "Loan Pmt"
    }'
  ```

  ```javascript Node.js
  const payment = await method.payments.create({
    amount: 5000,
    source: 'acc_JMJZT6r7iHi8e',
    destination: 'acc_AXthnzpBnxxWP',
    description: 'Loan Pmt',
  }, {
    idempotency_key: '24c47283-0cc8-43a0-8b4a-ce16d002de97',
  });
  ```

  ```python Python
  payment = method.payments.create({
    'amount': 5000,
    'source': 'acc_JMJZT6r7iHi8e',
    'destination': 'acc_AXthnzpBnxxWP',
    'description': 'Loan Pmt',
  }, {
    'idempotency_key': '24c47283-0cc8-43a0-8b4a-ce16d002de97'
  })
  ```
</RequestExample>

<ResponseExample>
  ```json
  {
    "error": {
      "type": "API_ERROR",
      "code": 503,
      "sub_type": "IDEMPOTENCY_UNAVAILABLE",
      "message": "Idempotent requests are temporarily unavailable. To ensure idempotency try your request later, or fall back to a non-idempotent request."
    }
  }
  ```
</ResponseExample>


# Introduction



👋 Welcome to Method! Method's API enables financial connectivity to any consumer liability account. Method provides real-time, permissioned read/write access at every major financial institution.

Here you will find everything you need to get started with the Method API. If you have any questions, please email us [team@methodfi.com](mailto:team@methodfi.com), or via our shared slack channel.

🚀 We cannot wait to see what you'll build!


# IP Whitelisting



Method webhooks will only be emitted from the following IP address.

In order to provide additional network security to your system when handling Method webhooks, you can whitelist the following IP addresses for each environment.

| Environment | Host                              | IPs                             |
| ----------- | --------------------------------- | ------------------------------- |
| Development | `https://dev.methodfi.com`        | `35.82.103.24` `54.188.83.35`   |
| Sandbox     | `https://sandbox.methodfi.com`    | `52.11.69.13` `52.12.28.169`    |
| Production  | `https://production.methodfi.com` | `34.213.118.45` `44.235.25.170` |


# List all Merchants

GET /merchants

export const ParamList = ({items, is_child = false}) => {
  return items.map(item => {
    const field_props = {
      id: Math.random().toString(),
      body: item.name,
      name: item.name,
      type: item.type,
      required: item.required
    };
    const enums = item.enums || [];
    const items = item.items || [];
    const has_items = items?.length > 0;
    const has_enums = enums?.length > 0;
    const should_default_open = item.defaultOpen | false;
    const render_child_item = () => {
      const child_props = {
        title: has_enums ? "Possible enum values" : "properties"
      };
      if (should_default_open) child_props.defaultOpen = true;
      const has_inline_enums = has_enums && enums.every(enum_item => typeof enum_item === 'string') && enums.map((enum_item, idx) => {
        const is_last = idx === enums.length - 1;
        const is_2nd_to_last = idx === enums.length - 2;
        return <>
            <code>{enum_item}</code>
            {is_last && ''}
            {is_2nd_to_last && ' or '}
            {!is_last && !is_2nd_to_last && ', '}
          </>;
      });
      const enum_list = has_enums && !has_inline_enums && <Accordion {...child_props}>
          {enums.map(enum_item => <>
              <code>{enum_item.name}</code>
              <br />
              <p>{enum_item.description}</p>
            </>)}
        </Accordion>;
      const item_list = has_items && <Expandable {...child_props}>
          <ParamList items={items || []} is_child />
        </Expandable>;
      return <>
          <p>
            {item.description}
            {has_inline_enums && [has_inline_enums.length > 1 ? ' One of ' : ' Must be ', ...has_inline_enums]}
          </p>

          {enum_list}
          {item_list}
        </>;
    };
    return is_child ? <ResponseField {...field_props}>{render_child_item()}</ResponseField> : <ParamField {...field_props}>{render_child_item()}</ParamField>;
  });
};

Returns a list of Merchants that satisfy the provided filters.

## Query Parameters

<ParamList
  items={[
  {
  name: 'name',
  type: 'string',
  required: false,
  description: 'The name of the Merchant to filter for.',
  },
  {
  name: 'type',
  type: 'enum',
  required: false,
  description: 'The liability type supported by the Merchant.',
  enums: ['credit_card', 'auto_loan', 'student_loan', 'personal_loan', 'mortgage'],
  },
  {
  name: 'creditor_name',
  type: 'string',
  required: false,
  description: (
    <>
      The name of the creditor as seen in a credit
      report. Ex. <code>JPMCB CARD</code> pertains
      to a Chase Credit Card.
    </>
  ),
  },
  {
  name: 'provider_id.plaid',
  type: 'string',
  required: false,
  description: 'The Plaid Institution ID for the Merchant to filter for.',
  },
  {
  name: 'provider_id.mx',
  type: 'string',
  required: false,
  description: 'The MX ID for the Merchant to filter for.',
  },
  {
  name: 'provider_id.finicity',
  type: 'string',
  required: false,
  description: 'The Finicity ID for the Merchant to filter for.',
  },
  {
  name: 'provider_id.dpp',
  type: 'string',
  required: false,
  description: 'The DebtPayPro ID for the Merchant to filter for.',
  },
  ]}
/>

## Returns

Returns a list of Merchants objects.

<RequestExample>
  ```bash cURL
  curl "https://production.methodfi.com/merchants?name=Capital One" \
    -H "Method-Version: 2024-04-04" \
    -H "Authorization: Bearer sk_WyZEWVfTcH7GqmPzUPk65Vjc"
  ```

  ```javascript Node.js
  const merchants = await method.merchants.list({
    name: 'Capital One',
    type: 'credit_card',
  });
  ```

  ```python Python
  merchants = method.merchants.list({
    'name': 'Capital One',
    'type': 'credit_card'
  })
  ```
</RequestExample>

<ResponseExample>
  ```json
  {
    "data": [
      {
        "id": "mch_301761",
        "parent_name": "Capital One",
        "name": "Capital One Credit Card",
        "logo": "https://static.methodfi.com/mch_logos/mch_301761.png",
        "type": "credit_card",
        "provider_ids": {
          "plaid": [
            "ins_9",
            "ins_128026"
          ],
          "mx": [
            "capital_one"
          ],
          "finicity": [],
          "dpp": [
            "9366979",
            "18372457",
            "18431971",
            "18373255",
            "14444930"
          ]
        },
        "is_temp": false,
        "account_number_formats": [
          "################"
        ]
      }
    ]
  }
  ```
</ResponseExample>


# The merchant endpoint



export const ParamList = ({items, is_child = false}) => {
  return items.map(item => {
    const field_props = {
      id: Math.random().toString(),
      body: item.name,
      name: item.name,
      type: item.type,
      required: item.required
    };
    const enums = item.enums || [];
    const items = item.items || [];
    const has_items = items?.length > 0;
    const has_enums = enums?.length > 0;
    const should_default_open = item.defaultOpen | false;
    const render_child_item = () => {
      const child_props = {
        title: has_enums ? "Possible enum values" : "properties"
      };
      if (should_default_open) child_props.defaultOpen = true;
      const has_inline_enums = has_enums && enums.every(enum_item => typeof enum_item === 'string') && enums.map((enum_item, idx) => {
        const is_last = idx === enums.length - 1;
        const is_2nd_to_last = idx === enums.length - 2;
        return <>
            <code>{enum_item}</code>
            {is_last && ''}
            {is_2nd_to_last && ' or '}
            {!is_last && !is_2nd_to_last && ', '}
          </>;
      });
      const enum_list = has_enums && !has_inline_enums && <Accordion {...child_props}>
          {enums.map(enum_item => <>
              <code>{enum_item.name}</code>
              <br />
              <p>{enum_item.description}</p>
            </>)}
        </Accordion>;
      const item_list = has_items && <Expandable {...child_props}>
          <ParamList items={items || []} is_child />
        </Expandable>;
      return <>
          <p>
            {item.description}
            {has_inline_enums && [has_inline_enums.length > 1 ? ' One of ' : ' Must be ', ...has_inline_enums]}
          </p>

          {enum_list}
          {item_list}
        </>;
    };
    return is_child ? <ResponseField {...field_props}>{render_child_item()}</ResponseField> : <ParamField {...field_props}>{render_child_item()}</ParamField>;
  });
};

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.

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

  Ex. Capital One Credit Card (<code>mch\_301761</code>) is
  different from Capital One Auto Loan (<code>mch\_301760</code>)
</Note>

## Merchant Objects

<ParamList
  items={[
  {
  name: 'id',
  type: 'string',
  description: 'Unique identifier for the Merchant.',
  },
  {
  name: 'parent_name',
  type: 'string',
  description: 'The presentable name of the financial institution',
  },
  {
  name: 'name',
  type: 'string',
  description: 'The presentable name of the Merchant.',
  },
  {
  name: 'logo',
  type: 'string',
  description: 'A URL to the Merchant\'s logo.',
  },
  {
  name: 'type',
  type: 'enum',
  description: 'The liability type supported by the Merchant.',
  enums: ['credit_card', 'auto_loan', 'student_loan', 'personal_loan', 'mortgage'],
  },
  {
  name: 'provider_ids',
  type: 'object',
  description: 'Related IDs for this Merchant in third-party aggregators.',
  items: [
    {
      name: 'provider_ids.plaid',
      type: 'string[]',
      description: 'A list of Plaid Institution IDs corresponding to this Merchant.',
    },
    {
      name: 'provider_ids.mx',
      type: 'string[]',
      description: 'A list of MX IDs for this Merchant.',
    },
    {
      name: 'provider_ids.finicity',
      type: 'string[]',
      description: 'A list of Finicity IDs for this Merchant.',
    },
    {
      name: 'provider_ids.dpp',
      type: 'string[]',
      description: 'A list of DebtPayPro IDs for this Merchant.',
    }
  ]
  },
  {
  name: 'is_temp',
  type: 'boolean',
  description: (
    <>
      A field indicating whether a Merchant will later mapped to a permanently managed Merchant. Temp
      Merchants are susceptible to change, and provide limited functionality.
      <br/>
      <br/>
      Accounts associated with a temp Merchant will be updated once changes occur on the temp Merchant.
    </>
  ),
  },
  {
  name: 'account_number_formats',
  type: 'string[]',
  description: (
    <>
      A guiding list of formats for account numbers corresponding to this Merchant. No validation
      is done against this list.
    </>
  ),
  },
  ]}
/>

<RequestExample>
  ```json THE MERCHANT OBJECT
  {
    "id": "mch_301761",
    "parent_name": "Capital One",
    "name": "Capital One Credit Card",
    "logo": "https://static.methodfi.com/mch_logos/mch_301761.png",
    "type": "credit_card",
    "provider_ids": {
      "plaid": [
        "ins_9",
        "ins_128026"
      ],
      "mx": [
        "capital_one"
      ],
      "finicity": [],
      "dpp": [
        "9366979",
        "18372457",
        "18431971",
        "18373255",
        "14444930"
      ]
    },
    "is_temp": false,
    "account_number_formats": [
      "################"
    ]
  }
  ```
</RequestExample>


# Retrieve a Merchant

GET /merchants/{mch_id}

export const ParamList = ({items, is_child = false}) => {
  return items.map(item => {
    const field_props = {
      id: Math.random().toString(),
      body: item.name,
      name: item.name,
      type: item.type,
      required: item.required
    };
    const enums = item.enums || [];
    const items = item.items || [];
    const has_items = items?.length > 0;
    const has_enums = enums?.length > 0;
    const should_default_open = item.defaultOpen | false;
    const render_child_item = () => {
      const child_props = {
        title: has_enums ? "Possible enum values" : "properties"
      };
      if (should_default_open) child_props.defaultOpen = true;
      const has_inline_enums = has_enums && enums.every(enum_item => typeof enum_item === 'string') && enums.map((enum_item, idx) => {
        const is_last = idx === enums.length - 1;
        const is_2nd_to_last = idx === enums.length - 2;
        return <>
            <code>{enum_item}</code>
            {is_last && ''}
            {is_2nd_to_last && ' or '}
            {!is_last && !is_2nd_to_last && ', '}
          </>;
      });
      const enum_list = has_enums && !has_inline_enums && <Accordion {...child_props}>
          {enums.map(enum_item => <>
              <code>{enum_item.name}</code>
              <br />
              <p>{enum_item.description}</p>
            </>)}
        </Accordion>;
      const item_list = has_items && <Expandable {...child_props}>
          <ParamList items={items || []} is_child />
        </Expandable>;
      return <>
          <p>
            {item.description}
            {has_inline_enums && [has_inline_enums.length > 1 ? ' One of ' : ' Must be ', ...has_inline_enums]}
          </p>

          {enum_list}
          {item_list}
        </>;
    };
    return is_child ? <ResponseField {...field_props}>{render_child_item()}</ResponseField> : <ParamField {...field_props}>{render_child_item()}</ParamField>;
  });
};

Returns the Merchant object associated with the ID.

## Path Parameters

<ParamList
  items={[
  {
  name: 'mch_id',
  type: 'string',
  required: true,
  description: 'ID of the Merchant',
  },
  ]}
/>

## Returns

Returns the Merchant object associated with the ID.

<RequestExample>
  ```bash cURL
  curl https://production.methodfi.com/merchants/mch_301761 \
    -H "Method-Version: 2024-04-04" \
    -H "Authorization: Bearer sk_WyZEWVfTcH7GqmPzUPk65Vjc"
  ```

  ```javascript Node.js
  const merchant = await method.merchants.retrieve('mch_301761');
  ```

  ```python Python
  merchant = method.merchants.retrieve('mch_301761')
  ```
</RequestExample>

<ResponseExample>
  ```json
  {
    "id": "mch_301761",
    "parent_name": "Capital One",
    "name": "Capital One Credit Card",
    "logo": "https://static.methodfi.com/mch_logos/mch_301761.png",
    "type": "credit_card",
    "provider_ids": {
      "plaid": [
        "ins_9",
        "ins_128026"
      ],
      "mx": [
        "capital_one"
      ],
      "finicity": [],
      "dpp": [
        "9366979",
        "18372457",
        "18431971",
        "18373255",
        "14444930"
      ]
    },
    "is_temp": false,
    "account_number_formats": [
      "################"
    ]
  }
  ```
</ResponseExample>


# Metadata



Method allows you to provide arbitrary data upon creation of any Core API resource. This
data is referred to as **metadata** and will be returned as the `metadata` attribute
on any Core API resource.

Adding metadata to Core API resources is useful if you want to provide additional identifiers
that reference specific records or rows in your own database.

## Props

<ParamField query="metadata" type="object">
  A valid JSON object that must be less than 1KB in size when serialized.
</ParamField>

## Returns

Returns the created resource with the provided metadata object.

<RequestExample>
  ```bash cURL
  curl https://production.methodfi.com/entities \
    -X POST \
    -H "Method-Version: 2024-04-04" \
    -H "Authorization: Bearer sk_WyZEWVfTcH7GqmPzUPk65Vjc" \
    -H "Content-Type: application/json" \
    -d '{
      "type": "individual",
      "individual": {
        "first_name": "Kevin",
        "last_name": "Doyle",
        "phone": "+16505555555",
        "email": "kevin.doyle@gmail.com",
        "dob": "1997-03-18"
      },
      "metadata": {
        "user_id": "usr_jVFNtdlhDQnd92",
        "username": "kdoyle",
      }
    }'
  ```

  ```javascript Node.js
  const entity = await method.entities.create({
    type: 'individual',
    individual: {
      first_name: 'Kevin',
      last_name: 'Doyle',
      phone: '+16505555555',
      email: 'kevin.doyle@gmail.com',
      dob: '1997-03-18',
    },
    metadata: {
      user_id: 'usr_jVFNtdlhDQnd92',
      username: 'kdoyle',
    }
  });
  ```

  ```python Python
  entity = method.entities.create({
    'type': 'individual',
    'individual': {
      'first_name': 'Kevin',
      'last_name': 'Doyle',
      'phone': '+16505555555',
      'email': 'kevin.doyle@gmail.com',
      'dob': '1997-03-18'
    },
    'metadata': {
      'user_id': 'usr_jVFNtdlhDQnd92',
      'username': 'kdoyle'
    }
  })
  ```
</RequestExample>


# Pagination



Core API endpoints that list records are returned in reverse chronological order, with the most recently created
resource showing up first. You may optionally provide the following pagination parameters to limit the
returned records.

## Props

<ParamField query="from_date" type="string">
  ISO 8601 formatted date (YYYY-MM-DD) to filter for records created on and after the date provided.
</ParamField>

<ParamField query="to_date" type="string">
  ISO 8601 formatted date (YYYY-MM-DD) to filter for records created on and before the date provided.
</ParamField>

<ParamField query="page" type="string">
  The number of the page to return.
</ParamField>

<ParamField query="page_cursor" type="string">
  The ID of a resource from which a page should start or end. Mutually exclusive with `page`.
</ParamField>

<ParamField query="page_limit" type="string">
  The number of records to return per page.
</ParamField>

## Returns

Returns a list of the requested resource with the applied pagination. Additionally, the following headers are returned with the response:

#### Response pagination headers

| Key                           | Description                                       |
| ----------------------------- | ------------------------------------------------- |
| `Pagination-Page`             | The current page.                                 |
| `Pagination-Page-Count`       | The total number of pages available.              |
| `Pagination-Page-Limit`       | The number of records to return per page.         |
| `Pagination-Total-Count`      | The total number of records matching the request. |
| `Pagination-Page-Cursor-Prev` | The previous page cursor.                         |
| `Pagination-Page-Cursor-Next` | The next page cursor.                             |

<RequestExample>
  ```bash cURL
  curl "https://production.methodfi.com/payments?page_limit=1&to_date=2020-12-10" \
    -H "Method-Version: 2024-04-04" \
    -H "Authorization: Bearer sk_WyZEWVfTcH7GqmPzUPk65Vjc"
  ```

  ```javascript Node.js
  const payments = await method.payments.list({
    page_limit: 1,
    to_date: '2020-12-10',
  });
  ```

  ```python Python
  payments = method.payments.list({
    'page_limit': 1,
    'to_date': '2020-12-10'
  })
  ```
</RequestExample>

<ResponseExample>
  ```json
  {
    "data": [
      {
        "id": "pmt_rPrDPEwyCVUcm",
        "reversal_id": null,
        "source_trace_id": null,
        "destination_trace_id": null,
        "source": "acc_JMJZT6r7iHi8e",
        "destination": "acc_AXthnzpBnxxWP",
        "amount": 5000,
        "description": "Loan Pmt",
        "status": "pending",
        "error": null,
        "metadata": null,
        "estimated_completion_date": "2020-12-11",
        "source_settlement_date": "2020-12-09",
        "destination_settlement_date": "2020-12-11",
        "fee": null,
        "created_at": "2020-12-09T00:42:31.209Z",
        "updated_at": "2020-12-09T00:43:30.996Z"
      }
    ]
  }
  ```
</ResponseExample>


# Create a Payment

POST /payments

export const ParamList = ({items, is_child = false}) => {
  return items.map(item => {
    const field_props = {
      id: Math.random().toString(),
      body: item.name,
      name: item.name,
      type: item.type,
      required: item.required
    };
    const enums = item.enums || [];
    const items = item.items || [];
    const has_items = items?.length > 0;
    const has_enums = enums?.length > 0;
    const should_default_open = item.defaultOpen | false;
    const render_child_item = () => {
      const child_props = {
        title: has_enums ? "Possible enum values" : "properties"
      };
      if (should_default_open) child_props.defaultOpen = true;
      const has_inline_enums = has_enums && enums.every(enum_item => typeof enum_item === 'string') && enums.map((enum_item, idx) => {
        const is_last = idx === enums.length - 1;
        const is_2nd_to_last = idx === enums.length - 2;
        return <>
            <code>{enum_item}</code>
            {is_last && ''}
            {is_2nd_to_last && ' or '}
            {!is_last && !is_2nd_to_last && ', '}
          </>;
      });
      const enum_list = has_enums && !has_inline_enums && <Accordion {...child_props}>
          {enums.map(enum_item => <>
              <code>{enum_item.name}</code>
              <br />
              <p>{enum_item.description}</p>
            </>)}
        </Accordion>;
      const item_list = has_items && <Expandable {...child_props}>
          <ParamList items={items || []} is_child />
        </Expandable>;
      return <>
          <p>
            {item.description}
            {has_inline_enums && [has_inline_enums.length > 1 ? ' One of ' : ' Must be ', ...has_inline_enums]}
          </p>

          {enum_list}
          {item_list}
        </>;
    };
    return is_child ? <ResponseField {...field_props}>{render_child_item()}</ResponseField> : <ParamField {...field_props}>{render_child_item()}</ParamField>;
  });
};

Creates a new Payment object.

Payments are transmitted electronically by pulling funds from a source Account,
and sending those funds to a destination Account. Payments are posted to the
destination Account (settled) in 1-2 business days but may vary per
FI (Financial Institution).

## Body

<ParamList
  items={[
  {
  name: 'amount',
  type: 'number',
  required: true,
  description: 'The amount of the payment to be created in cents. (e.g. $1.00 = 100)',
  },
  {
  name: 'source',
  type: 'string',
  required: true,
  description: (
    <>
      <p>
        The ID of an Account from which the Payment funds will be
        retrieved.
      </p>
      <p>
        Ensure that the following checks have been done on an
        Account before it is used as a Payment source:
      </p>
      <ul>
        <li>Both the status of the Account and its holder (Entity) is <code>active</code></li>
        <li>
          Both the Account and its holder have the <code>payments</code> value in
          their <code>products</code> property.
        </li>
      </ul>
    </>
  ),
  },
  {
  name: 'destination',
  type: 'string',
  required: true,
  description: (
    <>
      <p>
        The ID of an Account where the Payment funds will be sent to.
        In the Method ecosystem, these can be either <code>ach</code> or <code>liability</code> typed
        accounts.
      </p>
      <p>
        Ensure that the following checks have been done on an
        Account before it is used as a Payment destination:
      </p>
      <ul>
        <li>Both the status of the Account and its holder (Entity) is <code>active</code></li>
        <li>
          Both the Account and its holder have the <code>payments</code> value in
          their <code>products</code> property.
        </li>
      </ul>
    </>
  ),
  },
  {
  name: 'description',
  type: 'string',
  required: true,
  description: 'The Payment\'s description (maximum of 10 characters).',
  },
  {
  name: 'fee',
  type: 'object',
  required: false,
  description: (
    <>
      <p>
        Payment fee information. If provided, the payment will incur a fee which will be deducted from the
        total amount received by the destination Account.
      </p>
    </>
  ),
  items: [
    {
      name: 'fee.type',
      type: 'enum',
      required: false,
      description: 'The type of fee applied to the Payment.',
      enums: [
        {
          name: 'total',
          description: (
            <>
              This fee type will deduct a flat fee from the amount received
              by the destination Account.
            </>
          ),
        },
        {
          name: 'markup',
          description: (
            <>
              This fee type will deduct a fee on top of Method's per-payment fee
              from the amount received by the destination Account.
            </>
          ),
        },
      ],
    },
    {
      name: 'fee.amount',
      type: 'number',
      required: false,
      description: 'The amount (in cents) of the fee.',
    },
  ],
  },
  ]}
/>

## Returns

Returns a Payment object. The Payment will be sent based on the cutoff
times. The `status` of the Payment will be updated when the Payment is
sent to our banking networks.

<RequestExample>
  ```bash cURL
  curl https://production.methodfi.com/payments \
    -X POST \
    -H "Method-Version: 2024-04-04" \
    -H "Authorization: Bearer sk_WyZEWVfTcH7GqmPzUPk65Vjc" \
    -H "Content-Type: application/json" \
    -d '{
      "amount": 5000,
      "source": "acc_hmap9mbgfLcf9",
      "destination": "acc_YXDrjADGjC76U",
      "description": "Loan Pmt"
    }'
  ```

  ```javascript Node.js
  const payment = await method.payments.create({
    amount: 5000,
    source: 'acc_hmap9mbgfLcf9',
    destination: 'acc_YXDrjADGjC76U',
    description: 'Loan Pmt',
  });
  ```

  ```python Python
  payment = method.payments.create({
    'amount': 5000,
    'source': 'acc_hmap9mbgfLcf9',
    'destination': 'acc_YXDrjADGjC76U',
    'description': 'Loan Pmt'
  })
  ```
</RequestExample>

<ResponseExample>
  ```json
  {
    "id": "pmt_VeCfmkwGKb",
    "source": "acc_hmap9mbgfLcf9",
    "destination": "acc_YXDrjADGjC76U",
    "amount": 5000,
    "description": "Loan Pmt",
    "status": "pending",
    "estimated_completion_date": "2024-03-21",
    "source_trace_id": null,
    "source_settlement_date": "2024-03-15",
    "source_status": "pending",
    "destination_trace_id": null,
    "destination_settlement_date": "2024-03-21",
    "destination_status": "pending",
    "reversal_id": null,
    "fee": null,
    "error": null,
    "metadata": null,
    "created_at": "2024-03-14T16:15:26.074Z",
    "updated_at": "2024-03-14T16:15:26.074Z"
  }
  ```
</ResponseExample>


# Delete a Payment

DELETE /payments/{pmt_id}

export const ParamList = ({items, is_child = false}) => {
  return items.map(item => {
    const field_props = {
      id: Math.random().toString(),
      body: item.name,
      name: item.name,
      type: item.type,
      required: item.required
    };
    const enums = item.enums || [];
    const items = item.items || [];
    const has_items = items?.length > 0;
    const has_enums = enums?.length > 0;
    const should_default_open = item.defaultOpen | false;
    const render_child_item = () => {
      const child_props = {
        title: has_enums ? "Possible enum values" : "properties"
      };
      if (should_default_open) child_props.defaultOpen = true;
      const has_inline_enums = has_enums && enums.every(enum_item => typeof enum_item === 'string') && enums.map((enum_item, idx) => {
        const is_last = idx === enums.length - 1;
        const is_2nd_to_last = idx === enums.length - 2;
        return <>
            <code>{enum_item}</code>
            {is_last && ''}
            {is_2nd_to_last && ' or '}
            {!is_last && !is_2nd_to_last && ', '}
          </>;
      });
      const enum_list = has_enums && !has_inline_enums && <Accordion {...child_props}>
          {enums.map(enum_item => <>
              <code>{enum_item.name}</code>
              <br />
              <p>{enum_item.description}</p>
            </>)}
        </Accordion>;
      const item_list = has_items && <Expandable {...child_props}>
          <ParamList items={items || []} is_child />
        </Expandable>;
      return <>
          <p>
            {item.description}
            {has_inline_enums && [has_inline_enums.length > 1 ? ' One of ' : ' Must be ', ...has_inline_enums]}
          </p>

          {enum_list}
          {item_list}
        </>;
    };
    return is_child ? <ResponseField {...field_props}>{render_child_item()}</ResponseField> : <ParamField {...field_props}>{render_child_item()}</ParamField>;
  });
};

Deleting a Payment means canceling it before any funds
have been moved.

<Warning>
  Payments can be deleted only if its status is in <code>pending</code>
</Warning>

## Path Parameters

<ParamList
  items={[
  {
  name: 'pmt_id',
  type: 'string',
  required: true,
  description: 'ID of the Payment',
  },
  ]}
/>

## Returns

Returns the successfully deleted Payment with its
status set to `canceled`.

<RequestExample>
  ```bash cURL
  curl https://production.methodfi.com/payments/pmt_VeCfmkwGKb \
    -X DELETE \
    -H "Method-Version: 2024-04-04" \
    -H "Authorization: Bearer sk_WyZEWVfTcH7GqmPzUPk65Vjc"
  ```

  ```javascript Node.js
  const payment = await method.payments.delete('pmt_VeCfmkwGKb');
  ```

  ```python Python
  payment = method.payments.delete('pmt_VeCfmkwGKb')
  ```
</RequestExample>

<ResponseExample>
  ```json
  {
    "id": "pmt_VeCfmkwGKb",
    "source": "acc_hmap9mbgfLcf9",
    "destination": "acc_YXDrjADGjC76U",
    "amount": 5000,
    "description": "Loan Pmt",
    "status": "canceled",
    "estimated_completion_date": "2024-03-21",
    "source_trace_id": null,
    "source_settlement_date": "2024-03-15",
    "source_status": "canceled",
    "destination_trace_id": null,
    "destination_settlement_date": "2024-03-21",
    "destination_status": "canceled",
    "reversal_id": null,
    "fee": null,
    "error": null,
    "metadata": null,
    "created_at": "2024-03-14T16:15:26.074Z",
    "updated_at": "2024-03-14T16:15:26.074Z"
  }
  ```
</ResponseExample>


# List all Payments

GET /payments

export const get_pagination_defaults = (resource_name = 'records') => [{
  name: 'from_date',
  type: 'string',
  required: false,
  description: `ISO 8601 formatted date (YYYY-MM-DD) to filter for ${resource_name} created on and after the date provided.`
}, {
  name: 'to_date',
  type: 'string',
  required: false,
  description: `ISO 8601 formatted date (YYYY-MM-DD) to filter for ${resource_name} created on and before the date provided.`
}, {
  name: 'page',
  type: 'string',
  required: false,
  description: `The number of the page to return.`
}, {
  name: 'page_cursor',
  type: 'string',
  required: false,
  description: <>
        The ID of a resource from which a page should start or end. Mutually exclusive with <code>page</code>.
      </>
}, {
  name: 'page_limit',
  type: 'string',
  required: false,
  description: `The number of ${resource_name} to return per page.`
}];

export const ParamList = ({items, is_child = false}) => {
  return items.map(item => {
    const field_props = {
      id: Math.random().toString(),
      body: item.name,
      name: item.name,
      type: item.type,
      required: item.required
    };
    const enums = item.enums || [];
    const items = item.items || [];
    const has_items = items?.length > 0;
    const has_enums = enums?.length > 0;
    const should_default_open = item.defaultOpen | false;
    const render_child_item = () => {
      const child_props = {
        title: has_enums ? "Possible enum values" : "properties"
      };
      if (should_default_open) child_props.defaultOpen = true;
      const has_inline_enums = has_enums && enums.every(enum_item => typeof enum_item === 'string') && enums.map((enum_item, idx) => {
        const is_last = idx === enums.length - 1;
        const is_2nd_to_last = idx === enums.length - 2;
        return <>
            <code>{enum_item}</code>
            {is_last && ''}
            {is_2nd_to_last && ' or '}
            {!is_last && !is_2nd_to_last && ', '}
          </>;
      });
      const enum_list = has_enums && !has_inline_enums && <Accordion {...child_props}>
          {enums.map(enum_item => <>
              <code>{enum_item.name}</code>
              <br />
              <p>{enum_item.description}</p>
            </>)}
        </Accordion>;
      const item_list = has_items && <Expandable {...child_props}>
          <ParamList items={items || []} is_child />
        </Expandable>;
      return <>
          <p>
            {item.description}
            {has_inline_enums && [has_inline_enums.length > 1 ? ' One of ' : ' Must be ', ...has_inline_enums]}
          </p>

          {enum_list}
          {item_list}
        </>;
    };
    return is_child ? <ResponseField {...field_props}>{render_child_item()}</ResponseField> : <ParamField {...field_props}>{render_child_item()}</ParamField>;
  });
};

Returns a list of Payment objects.

## Query Parameters

<ParamList
  items={[
  {
  name: 'source',
  type: 'string',
  required: false,
  description: 'The ID of the Payment\'s source.',
  },
  {
  name: 'destination',
  type: 'string',
  required: false,
  description: 'The ID of the Payment\'s destination.',
  },
  {
  name: 'acc_id',
  type: 'string',
  required: false,
  description: 'The ID of either the Payment\'s source or destination.',
  },
  {
  name: 'source_holder_id',
  type: 'string',
  required: false,
  description: 'The ID of the Payment\'s source holder (Entity).',
  },
  {
  name: 'destination_holder_id',
  type: 'string',
  required: false,
  description: 'The ID of the Payment\'s destination holder (Entity).',
  },
  {
  name: 'holder_id',
  type: 'string',
  required: false,
  description: 'The ID of either of the Payment\'s source or destination holder (Entity).',
  },
  {
  name: 'status',
  type: 'string',
  required: false,
  description: 'The Payment\'s status.',
  },
  ...get_pagination_defaults('Payments'),
  ]}
/>

## Returns

Returns a list of Payment objects.

<RequestExample>
  ```bash cURL
  curl "https://production.methodfi.com/payments?from_date=2024-03-13&to_date=2024-03-15&status=pending" \
    -H "Method-Version: 2024-04-04" \
    -H "Authorization: Bearer sk_WyZEWVfTcH7GqmPzUPk65Vjc"
  ```

  ```javascript Node.js
  const payments = await method.payments.list({
    from_date: '2024-03-13',
    to_date: '2024-03-15',
    status: 'pending',
  });
  ```

  ```python Python
  payments = method.payments.list({
    'from_date': '2024-03-13',
    'to_date': '2024-03-15',
    'status': 'pending'
  })
  ```
</RequestExample>

<ResponseExample>
  ```json
  {
    "data": [
      {
        "id": "pmt_VeCfmkwGKb",
        "source": "acc_hmap9mbgfLcf9",
        "destination": "acc_YXDrjADGjC76U",
        "amount": 5000,
        "description": "Loan Pmt",
        "status": "pending",
        "estimated_completion_date": "2024-03-21",
        "source_trace_id": null,
        "source_settlement_date": "2024-03-15",
        "source_status": "pending",
        "destination_trace_id": null,
        "destination_settlement_date": "2024-03-21",
        "destination_status": "pending",
        "reversal_id": null,
        "fee": null,
        "error": null,
        "metadata": null,
        "created_at": "2024-03-14T16:15:26.074Z",
        "updated_at": "2024-03-14T16:15:26.074Z"
      }
    ]
  }
  ```
</ResponseExample>


# The payment endpoint



export const get_common_parameters = (resource_name = 'resource') => {
  return {
    id: {
      name: 'id',
      type: "string",
      required: false,
      description: `Unique identifier for the ${resource_name}.`
    },
    entity_id: {
      name: 'entity_id',
      type: 'string',
      required: false,
      description: 'The ID of the associated Entity.'
    },
    account_id: {
      name: 'account_id',
      type: 'string',
      required: false,
      description: 'The ID of the associated Account.'
    },
    error: {
      name: 'error',
      type: 'object | null',
      required: false,
      description: <>
          An object representing an error that occurred while processing
          this {resource_name}. See <a href={`/reference/errors/${resource_name.replace(/^([A-Z])/, function (match) {
        return match.toLowerCase();
      }).replace(/([A-Z])/g, function (match) {
        return "-" + match.toLowerCase();
      })}-errors`}>{resource_name} errors</a>.
        </>
    },
    status_error: {
      name: 'status_error',
      type: 'object | null',
      required: false,
      description: <>
          An object representing an error that occurred while processing
          this {resource_name}. See <a href="/reference/errors/product-errors#status-errors">{resource_name} errors</a>.
        </>
    },
    metadata: {
      name: 'metadata',
      type: 'object | null',
      required: false,
      description: <>
          Additional data provided during creation.
          See <a href="/reference/metadata">metadata</a>
        </>
    },
    created_at: {
      name: 'created_at',
      type: 'string',
      required: false,
      description: `Timestamp of when the ${resource_name} was created.`
    },
    updated_at: {
      name: 'updated_at',
      type: 'string',
      required: false,
      description: `Timestamp of when the ${resource_name} was last updated.`
    },
    status: (enums = []) => ({
      name: 'status',
      type: 'enum',
      required: false,
      description: `Status of the ${resource_name}.`,
      enums
    }),
    type: (enums = []) => ({
      name: 'type',
      type: 'enum',
      required: false,
      description: `The type of ${resource_name}.`,
      enums
    })
  };
};

export const ParamList = ({items, is_child = false}) => {
  return items.map(item => {
    const field_props = {
      id: Math.random().toString(),
      body: item.name,
      name: item.name,
      type: item.type,
      required: item.required
    };
    const enums = item.enums || [];
    const items = item.items || [];
    const has_items = items?.length > 0;
    const has_enums = enums?.length > 0;
    const should_default_open = item.defaultOpen | false;
    const render_child_item = () => {
      const child_props = {
        title: has_enums ? "Possible enum values" : "properties"
      };
      if (should_default_open) child_props.defaultOpen = true;
      const has_inline_enums = has_enums && enums.every(enum_item => typeof enum_item === 'string') && enums.map((enum_item, idx) => {
        const is_last = idx === enums.length - 1;
        const is_2nd_to_last = idx === enums.length - 2;
        return <>
            <code>{enum_item}</code>
            {is_last && ''}
            {is_2nd_to_last && ' or '}
            {!is_last && !is_2nd_to_last && ', '}
          </>;
      });
      const enum_list = has_enums && !has_inline_enums && <Accordion {...child_props}>
          {enums.map(enum_item => <>
              <code>{enum_item.name}</code>
              <br />
              <p>{enum_item.description}</p>
            </>)}
        </Accordion>;
      const item_list = has_items && <Expandable {...child_props}>
          <ParamList items={items || []} is_child />
        </Expandable>;
      return <>
          <p>
            {item.description}
            {has_inline_enums && [has_inline_enums.length > 1 ? ' One of ' : ' Must be ', ...has_inline_enums]}
          </p>

          {enum_list}
          {item_list}
        </>;
    };
    return is_child ? <ResponseField {...field_props}>{render_child_item()}</ResponseField> : <ParamField {...field_props}>{render_child_item()}</ParamField>;
  });
};

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.

#### Cutoff Times

Payments are processed on business days (Monday - Friday),
excluding US Banking Holidays.

<ul>
  <li>Source processing windows: 10:30 AM, 1:30 PM, and 4:30 PM CST</li>
  <li>Destination processing windows: 1:30 PM CST</li>
</ul>

## Payment Objects

<ParamList
  items={[
  get_common_parameters('Payment').id,
  {
  name: 'source',
  type: 'string',
  required: false,
  description: 'The ID of an Account from which the Payment funds will be retrieved.',
  },
  {
  name: 'destination',
  type: 'string',
  required: false,
  description: 'The ID of an Account where the Payment funds will be sent to.',
  },
  {
  name: 'amount',
  type: 'number',
  required: false,
  description: 'The amount, in cents, of the Payment. (e.g. $1.00 = 100)',
  },
  {
  name: 'description',
  type: 'string',
  required: false,
  description: 'The Payment\'s description (maximum of 10 characters).',
  },
  get_common_parameters('Payment').status([
  {
    name: 'pending',
    description: 'Initial status after the Payment is created. Payment will stay in this' +
      ' state until it is processed. Payment can be deleted in this state.',
  },
  {
    name: 'canceled',
    description: 'The Payment was canceled and was never processed.',
  },
  {
    name: 'processing',
    description: 'The Payment is being processed. At this point, the Payment can no longer be deleted.',
  },
  {
    name: 'failed',
    description: 'An error occurred while either pulling funds from the source Account or' +
      'pushing funds to the destination Account.',
  },
  {
    name: 'sent',
    description: 'The Payment has been executed and sent to the banking networks.',
  },
  {
    name: 'reversal_processing',
    description: 'The active reversal corresponding to this Payment has been approved and is being processed.',
  },
  {
    name: 'reversed',
    description: 'The active reversal has successfully been completed.',
  }
  ]),
  {
  name: 'estimated_completion_date',
  type: 'string | null',
  required: false,
  description: 'An estimated date, in ISO 8601 format (YYYY-MM-DD), on which the Payment should be completed.',
  },
  {
  name: 'source_trace_id',
  type: 'string | null',
  required: false,
  description: 'The underlying ID for the bank transaction on the source Account relating to this Payment.',
  },
  {
  name: 'source_settlement_date',
  type: 'string | null',
  required: false,
  description: 'An estimated date, in ISO 8601 format (YYYY-MM-DD), on which the funds ' +
    'pulled from the source Account will be completed.',
  },
  {
  name: 'source_status',
  type: 'enum',
  required: false,
  description: 'The status of the pulling of funds from the source Account.',
  enums: [
    {
      name: 'pending',
      description: 'The funds are scheduled to be pulled on the next cutoff window.',
    },
    {
      name: 'canceled',
      description: 'An error occurred while requesting to pull funds from the source Account.',
    },
    {
      name: 'returned',
      description: 'Failed to pull funds from the source Account.',
    },
    {
      name: 'sent',
      description: 'The funds were successfully pulled from the source Account.',
    }
  ],
  },
  {
  name: 'destination_trace_id',
  type: 'string | null',
  required: false,
  description: 'The underlying ID for the bank transaction on the destination Account relating to this Payment.',
  },
  {
  name: 'destination_settlement_date',
  type: 'string | null',
  required: false,
  description: 'An estimated date, in ISO 8601 format (YYYY-MM-DD), on which the funds ' +
    'sent to the destination Account will be completed.',
  },
  {
  name: 'destination_status',
  type: 'enum',
  required: false,
  description: 'The status of the push of funds to the destination Account.',
  enums: [
    {
      name: 'pending',
      description: 'The funds are scheduled to be pushed on the next cutoff window.',
    },
    {
      name: 'processing',
      description: 'A request to push the funds to the destination Account has been initiated.',
    },
    {
      name: 'failed',
      description: 'An error occurred while requesting to push funds to the destination Account.',
    },
    {
      name: 'sent',
      description: 'The funds were successfully pushed to the destination Account.',
    }
  ],
  },
  {
  name: 'reversal_id',
  type: 'string | null',
  required: false,
  description: 'The ID of an active Reversal.',
  },
  {
  name: 'fee',
  type: 'object | null',
  required: false,
  description: 'Payment fee information. If provided, the Payment will incur a fee which' +
    'will be deducted from the total amount received by the destination Account.',
  items: [
    {
      name: 'fee.type',
      type: 'enum',
      required: false,
      description: 'The type of fee applied to the Payment.',
      enums: [
        {
          name: 'total',
          description: (
            <>
              <p>
                This fee type will deduct a flat fee from the amount received
                by the destination Account.
              </p>
              <p>
                Example: If a $10.00 Payment is created with a total fee of $2.00, then the
                resulting amount received by the destination Account will be $8.00.
                This means that you make total of $2.00 from the Payment. However, the
                Method fee for this Payment will still be included in your monthly invoice.
              </p>
              <CodeBlock>
                Received by destination = Payment - Total fee
                <br />
                $8.00                   = $10.00  - $2.00
              </CodeBlock>
              <hr />
            </>
          ),
        },
        {
          name: 'markup',
          description: (
            <>
              <p>
                This fee type will deduct a fee on top of Method's per-Payment fee
                from the amount received by the destination Account.
              </p>
              <p>
                Example: If a $10.00 Payment is created with a markup fee of $2.00 and your
                Method fee is $1.00, then the resulting amount received by the destination Account
                will be $7.00 (Amount - Markup Fee - Method Fee). This means that you make
                $2.00 from the Payment. Additionally, the Method fee has already been covered by
                the source Account, and this completed Payment will not be included in your monthly invoice.
              </p>
              <CodeBlock>
                Received by destination = Payment - Markup fee - Method fee
                <br />
                $7.00                   = $10.00  - $2.00      - $1.00
              </CodeBlock>
            </>
          ),
        },
      ],
    },
    {
      name: 'fee.amount',
      type: 'number',
      required: false,
      description: 'The amount (in cents) of the fee.',
    },
  ],
  },
  {
  name: 'fund_status',
  type: 'enum',
  required: false,
  description: 'A status indicating the flow of funds throughout the lifecycle of the Payment.',
  enums: [
    {
      name: 'pending',
      description: 'Initial fund status after the Payment is created.',
    },
    {
      name: 'requested',
      description: 'The Payment funds have been requested from the source Account.',
    },
    {
      name: 'clearing',
      description: 'The Payment funds from the source Account have been received.',
    },
    {
      name: 'failed',
      description: 'The clearing of funds for a Payment have failed.',
    },
    {
      name: 'sent',
      description: 'The Payment funds have been sent to the destination Account.',
    }
  ],
  },
  get_common_parameters('Payment').error,
  get_common_parameters('Payment').metadata,
  get_common_parameters('Payment').created_at,
  get_common_parameters('Payment').updated_at,
  ]}
/>

<RequestExample>
  ```json THE PAYMENT OBJECT
  {
    "id": "pmt_VeCfmkwGKb",
    "source": "acc_hmap9mbgfLcf9",
    "destination": "acc_YXDrjADGjC76U",
    "amount": 5000,
    "description": "Loan Pmt",
    "status": "pending",
    "estimated_completion_date": "2024-03-21",
    "source_trace_id": null,
    "source_settlement_date": "2024-03-15",
    "source_status": "pending",
    "destination_trace_id": null,
    "destination_settlement_date": "2024-03-21",
    "destination_status": "pending",
    "reversal_id": null,
    "fee": null,
    "error": null,
    "metadata": null,
    "created_at": "2024-03-14T16:15:26.074Z",
    "updated_at": "2024-03-14T16:15:26.074Z"
  }
  ```
</RequestExample>


# Retrieve a Payment

GET /payments/{pmt_id}

export const ParamList = ({items, is_child = false}) => {
  return items.map(item => {
    const field_props = {
      id: Math.random().toString(),
      body: item.name,
      name: item.name,
      type: item.type,
      required: item.required
    };
    const enums = item.enums || [];
    const items = item.items || [];
    const has_items = items?.length > 0;
    const has_enums = enums?.length > 0;
    const should_default_open = item.defaultOpen | false;
    const render_child_item = () => {
      const child_props = {
        title: has_enums ? "Possible enum values" : "properties"
      };
      if (should_default_open) child_props.defaultOpen = true;
      const has_inline_enums = has_enums && enums.every(enum_item => typeof enum_item === 'string') && enums.map((enum_item, idx) => {
        const is_last = idx === enums.length - 1;
        const is_2nd_to_last = idx === enums.length - 2;
        return <>
            <code>{enum_item}</code>
            {is_last && ''}
            {is_2nd_to_last && ' or '}
            {!is_last && !is_2nd_to_last && ', '}
          </>;
      });
      const enum_list = has_enums && !has_inline_enums && <Accordion {...child_props}>
          {enums.map(enum_item => <>
              <code>{enum_item.name}</code>
              <br />
              <p>{enum_item.description}</p>
            </>)}
        </Accordion>;
      const item_list = has_items && <Expandable {...child_props}>
          <ParamList items={items || []} is_child />
        </Expandable>;
      return <>
          <p>
            {item.description}
            {has_inline_enums && [has_inline_enums.length > 1 ? ' One of ' : ' Must be ', ...has_inline_enums]}
          </p>

          {enum_list}
          {item_list}
        </>;
    };
    return is_child ? <ResponseField {...field_props}>{render_child_item()}</ResponseField> : <ParamField {...field_props}>{render_child_item()}</ParamField>;
  });
};

Retrieve details of an existing Payment.

## Path Parameters

<ParamList
  items={[
  {
  name: 'pmt_id',
  type: 'string',
  required: true,
  description: 'ID of the Payment',
  },
  ]}
/>

## Returns

Returns the corresponding Payment if it exists.

<RequestExample>
  ```bash cURL
  curl https://production.methodfi.com/payments/pmt_VeCfmkwGKb \
    -H "Method-Version: 2024-04-04" \
    -H "Authorization: Bearer sk_WyZEWVfTcH7GqmPzUPk65Vjc"
  ```

  ```javascript Node.js
  const payment = await method.payments.retrieve('pmt_VeCfmkwGKb');
  ```

  ```python Python
  payment = method.payments.retrieve('pmt_VeCfmkwGKb')
  ```
</RequestExample>

<ResponseExample>
  ```json
  {
    "id": "pmt_VeCfmkwGKb",
    "source": "acc_hmap9mbgfLcf9",
    "destination": "acc_YXDrjADGjC76U",
    "amount": 5000,
    "description": "Loan Pmt",
    "status": "pending",
    "estimated_completion_date": "2024-03-21",
    "source_trace_id": null,
    "source_settlement_date": "2024-03-15",
    "source_status": "pending",
    "destination_trace_id": null,
    "destination_settlement_date": "2024-03-21",
    "destination_status": "pending",
    "reversal_id": null,
    "fee": null,
    "error": null,
    "metadata": null,
    "created_at": "2024-03-14T16:15:26.074Z",
    "updated_at": "2024-03-14T16:15:26.074Z"
  }
  ```
</ResponseExample>


# Create a Report

POST /reports

export const ParamList = ({items, is_child = false}) => {
  return items.map(item => {
    const field_props = {
      id: Math.random().toString(),
      body: item.name,
      name: item.name,
      type: item.type,
      required: item.required
    };
    const enums = item.enums || [];
    const items = item.items || [];
    const has_items = items?.length > 0;
    const has_enums = enums?.length > 0;
    const should_default_open = item.defaultOpen | false;
    const render_child_item = () => {
      const child_props = {
        title: has_enums ? "Possible enum values" : "properties"
      };
      if (should_default_open) child_props.defaultOpen = true;
      const has_inline_enums = has_enums && enums.every(enum_item => typeof enum_item === 'string') && enums.map((enum_item, idx) => {
        const is_last = idx === enums.length - 1;
        const is_2nd_to_last = idx === enums.length - 2;
        return <>
            <code>{enum_item}</code>
            {is_last && ''}
            {is_2nd_to_last && ' or '}
            {!is_last && !is_2nd_to_last && ', '}
          </>;
      });
      const enum_list = has_enums && !has_inline_enums && <Accordion {...child_props}>
          {enums.map(enum_item => <>
              <code>{enum_item.name}</code>
              <br />
              <p>{enum_item.description}</p>
            </>)}
        </Accordion>;
      const item_list = has_items && <Expandable {...child_props}>
          <ParamList items={items || []} is_child />
        </Expandable>;
      return <>
          <p>
            {item.description}
            {has_inline_enums && [has_inline_enums.length > 1 ? ' One of ' : ' Must be ', ...has_inline_enums]}
          </p>

          {enum_list}
          {item_list}
        </>;
    };
    return is_child ? <ResponseField {...field_props}>{render_child_item()}</ResponseField> : <ParamField {...field_props}>{render_child_item()}</ParamField>;
  });
};

Creates a new Report for a specific `type`. Once created, you
can retrieve the Report results from the URL returned.

## Path Parameters

<ParamList
  items={[
  {
  name: 'type',
  type: 'enum',
  required: true,
  description: (
    <>
      The filter type for this Report.
      See <a href="/reference/reports/overview#report-types">Report Types.</a>
    </>
  ),
  },
  ]}
/>

## Returns

Returns a Report object.

<RequestExample>
  ```bash cURL
  curl https://production.methodfi.com/reports \
    -X POST \
    -H "Method-Version: 2024-04-04" \
    -H "Authorization: Bearer sk_WyZEWVfTcH7GqmPzUPk65Vjc" \
    -H "Content-Type: application/json" \
    -d '{
      "type": "payments.created.current"
    }'
  ```

  ```javascript Node.js
  const report = await method.reports.create({ type: 'payments.created.current' });
  ```

  ```python Python
  report = method.reports.create({ 'type': 'payments.created.current' })
  ```
</RequestExample>

<ResponseExample>
  ```json
  {
    "id": "rpt_cj2mkA3hFyHT5",
    "type": "payments.created.current",
    "url": "https://production.methodfi.com/reports/rpt_cj2mkA3hFyHT5/download",
    "status": "completed",
    "metadata": null,
    "created_at": "2021-08-25T23:18:05.261Z",
    "updated_at": "2021-08-25T23:18:05.261Z"
  }
  ```
</ResponseExample>


# Download a Report

GET /reports/{rpt_id}/download

export const ParamList = ({items, is_child = false}) => {
  return items.map(item => {
    const field_props = {
      id: Math.random().toString(),
      body: item.name,
      name: item.name,
      type: item.type,
      required: item.required
    };
    const enums = item.enums || [];
    const items = item.items || [];
    const has_items = items?.length > 0;
    const has_enums = enums?.length > 0;
    const should_default_open = item.defaultOpen | false;
    const render_child_item = () => {
      const child_props = {
        title: has_enums ? "Possible enum values" : "properties"
      };
      if (should_default_open) child_props.defaultOpen = true;
      const has_inline_enums = has_enums && enums.every(enum_item => typeof enum_item === 'string') && enums.map((enum_item, idx) => {
        const is_last = idx === enums.length - 1;
        const is_2nd_to_last = idx === enums.length - 2;
        return <>
            <code>{enum_item}</code>
            {is_last && ''}
            {is_2nd_to_last && ' or '}
            {!is_last && !is_2nd_to_last && ', '}
          </>;
      });
      const enum_list = has_enums && !has_inline_enums && <Accordion {...child_props}>
          {enums.map(enum_item => <>
              <code>{enum_item.name}</code>
              <br />
              <p>{enum_item.description}</p>
            </>)}
        </Accordion>;
      const item_list = has_items && <Expandable {...child_props}>
          <ParamList items={items || []} is_child />
        </Expandable>;
      return <>
          <p>
            {item.description}
            {has_inline_enums && [has_inline_enums.length > 1 ? ' One of ' : ' Must be ', ...has_inline_enums]}
          </p>

          {enum_list}
          {item_list}
        </>;
    };
    return is_child ? <ResponseField {...field_props}>{render_child_item()}</ResponseField> : <ParamField {...field_props}>{render_child_item()}</ParamField>;
  });
};

Returns the results of the Report associated with the ID.

## Path Parameters

<ParamList
  items={[
  {
  name: 'rpt_id',
  type: 'string',
  required: true,
  description: 'ID of the Report to download.',
  },
  ]}
/>

## Returns

Returns the Report's results in CSV format.

<RequestExample>
  ```bash cURL
  curl https://production.methodfi.com/reports/rpt_cj2mkA3hFyHT5/download \
    -H "Method-Version: 2024-04-04" \
    -H "Authorization: Bearer sk_WyZEWVfTcH7GqmPzUPk65Vjc"
  ```

  ```javascript Node.js
  const reportCSV = await method.reports.download('rpt_cj2mkA3hFyHT5');
  ```

  ```python Python
  report_csv = method.reports.download('rpt_cj2mkA3hFyHT5')
  ```
</RequestExample>


# The report endpoint



export const get_common_parameters = (resource_name = 'resource') => {
  return {
    id: {
      name: 'id',
      type: "string",
      required: false,
      description: `Unique identifier for the ${resource_name}.`
    },
    entity_id: {
      name: 'entity_id',
      type: 'string',
      required: false,
      description: 'The ID of the associated Entity.'
    },
    account_id: {
      name: 'account_id',
      type: 'string',
      required: false,
      description: 'The ID of the associated Account.'
    },
    error: {
      name: 'error',
      type: 'object | null',
      required: false,
      description: <>
          An object representing an error that occurred while processing
          this {resource_name}. See <a href={`/reference/errors/${resource_name.replace(/^([A-Z])/, function (match) {
        return match.toLowerCase();
      }).replace(/([A-Z])/g, function (match) {
        return "-" + match.toLowerCase();
      })}-errors`}>{resource_name} errors</a>.
        </>
    },
    status_error: {
      name: 'status_error',
      type: 'object | null',
      required: false,
      description: <>
          An object representing an error that occurred while processing
          this {resource_name}. See <a href="/reference/errors/product-errors#status-errors">{resource_name} errors</a>.
        </>
    },
    metadata: {
      name: 'metadata',
      type: 'object | null',
      required: false,
      description: <>
          Additional data provided during creation.
          See <a href="/reference/metadata">metadata</a>
        </>
    },
    created_at: {
      name: 'created_at',
      type: 'string',
      required: false,
      description: `Timestamp of when the ${resource_name} was created.`
    },
    updated_at: {
      name: 'updated_at',
      type: 'string',
      required: false,
      description: `Timestamp of when the ${resource_name} was last updated.`
    },
    status: (enums = []) => ({
      name: 'status',
      type: 'enum',
      required: false,
      description: `Status of the ${resource_name}.`,
      enums
    }),
    type: (enums = []) => ({
      name: 'type',
      type: 'enum',
      required: false,
      description: `The type of ${resource_name}.`,
      enums
    })
  };
};

export const ParamList = ({items, is_child = false}) => {
  return items.map(item => {
    const field_props = {
      id: Math.random().toString(),
      body: item.name,
      name: item.name,
      type: item.type,
      required: item.required
    };
    const enums = item.enums || [];
    const items = item.items || [];
    const has_items = items?.length > 0;
    const has_enums = enums?.length > 0;
    const should_default_open = item.defaultOpen | false;
    const render_child_item = () => {
      const child_props = {
        title: has_enums ? "Possible enum values" : "properties"
      };
      if (should_default_open) child_props.defaultOpen = true;
      const has_inline_enums = has_enums && enums.every(enum_item => typeof enum_item === 'string') && enums.map((enum_item, idx) => {
        const is_last = idx === enums.length - 1;
        const is_2nd_to_last = idx === enums.length - 2;
        return <>
            <code>{enum_item}</code>
            {is_last && ''}
            {is_2nd_to_last && ' or '}
            {!is_last && !is_2nd_to_last && ', '}
          </>;
      });
      const enum_list = has_enums && !has_inline_enums && <Accordion {...child_props}>
          {enums.map(enum_item => <>
              <code>{enum_item.name}</code>
              <br />
              <p>{enum_item.description}</p>
            </>)}
        </Accordion>;
      const item_list = has_items && <Expandable {...child_props}>
          <ParamList items={items || []} is_child />
        </Expandable>;
      return <>
          <p>
            {item.description}
            {has_inline_enums && [has_inline_enums.length > 1 ? ' One of ' : ' Must be ', ...has_inline_enums]}
          </p>

          {enum_list}
          {item_list}
        </>;
    };
    return is_child ? <ResponseField {...field_props}>{render_child_item()}</ResponseField> : <ParamField {...field_props}>{render_child_item()}</ParamField>;
  });
};

Reports provide a filtered snapshot view of a specific
resource. Method provides a fixed set of filters (<a href="#report-types">Report Types</a>)
which include the following:

*   The resource to filter
*   The applied filter
*   The snapshot window

## Report Objects

<ParamList
  items={[
  get_common_parameters('Report').id,
  {
  name: 'type',
  type: 'enum',
  description: (
    <>
      The filter type for this Report. See <a href="/reference/reports/overview#report-types">Report Types.</a>
    </>
  ),
  },
  {
  name: 'url',
  type: 'string',
  description: 'The URL to a file containing the results of the Report.',
  },
  get_common_parameters('Report').status([
  'processing',
  'completed',
  ]),
  get_common_parameters('Report').metadata,
  get_common_parameters('Report').created_at,
  get_common_parameters('Report').updated_at,
  ]}
/>

#### Report Types

| Name                            |
| ------------------------------- |
| `ach.pull.nightly`              |
| `ach.pull.previous`             |
| `ach.pull.upcoming`             |
| `ach.reversals.nightly`         |
| `entities.created.previous_day` |
| `payments.created.current`      |
| `payments.created.previous`     |
| `payments.created.previous_day` |
| `payments.failed.previous_day`  |
| `payments.updated.current`      |
| `payments.updated.previous`     |

<RequestExample>
  ```json THE REPORT OBJECT
  {
    "id": "rpt_cj2mkA3hFyHT5",
    "type": "payments.created.current",
    "url": "https://production.methodfi.com/reports/rpt_cj2mkA3hFyHT5/download",
    "status": "completed",
    "metadata": null,
    "created_at": "2021-08-25T23:18:05.261Z",
    "updated_at": "2021-08-25T23:18:05.261Z"
  }
  ```
</RequestExample>


# Retrieve a Report

GET /reports/{rpt_id}

export const ParamList = ({items, is_child = false}) => {
  return items.map(item => {
    const field_props = {
      id: Math.random().toString(),
      body: item.name,
      name: item.name,
      type: item.type,
      required: item.required
    };
    const enums = item.enums || [];
    const items = item.items || [];
    const has_items = items?.length > 0;
    const has_enums = enums?.length > 0;
    const should_default_open = item.defaultOpen | false;
    const render_child_item = () => {
      const child_props = {
        title: has_enums ? "Possible enum values" : "properties"
      };
      if (should_default_open) child_props.defaultOpen = true;
      const has_inline_enums = has_enums && enums.every(enum_item => typeof enum_item === 'string') && enums.map((enum_item, idx) => {
        const is_last = idx === enums.length - 1;
        const is_2nd_to_last = idx === enums.length - 2;
        return <>
            <code>{enum_item}</code>
            {is_last && ''}
            {is_2nd_to_last && ' or '}
            {!is_last && !is_2nd_to_last && ', '}
          </>;
      });
      const enum_list = has_enums && !has_inline_enums && <Accordion {...child_props}>
          {enums.map(enum_item => <>
              <code>{enum_item.name}</code>
              <br />
              <p>{enum_item.description}</p>
            </>)}
        </Accordion>;
      const item_list = has_items && <Expandable {...child_props}>
          <ParamList items={items || []} is_child />
        </Expandable>;
      return <>
          <p>
            {item.description}
            {has_inline_enums && [has_inline_enums.length > 1 ? ' One of ' : ' Must be ', ...has_inline_enums]}
          </p>

          {enum_list}
          {item_list}
        </>;
    };
    return is_child ? <ResponseField {...field_props}>{render_child_item()}</ResponseField> : <ParamField {...field_props}>{render_child_item()}</ParamField>;
  });
};

Returns the Report object associated with the ID.

## Path Parameters

<ParamList
  items={[
  {
  name: 'rpt_id',
  type: 'string',
  required: true,
  description: 'ID of the Report',
  },
  ]}
/>

## Returns

Returns the Report object associated with the ID.

<RequestExample>
  ```bash cURL
  curl https://production.methodfi.com/reports/rpt_cj2mkA3hFyHT5 \
    -H "Method-Version: 2024-04-04" \
    -H "Authorization: Bearer sk_WyZEWVfTcH7GqmPzUPk65Vjc"
  ```

  ```javascript Node.js
  const report = await method.reports.retrieve('rpt_cj2mkA3hFyHT5');
  ```

  ```python Python
  report = method.reports.retrieve('rpt_cj2mkA3hFyHT5')
  ```
</RequestExample>

<ResponseExample>
  ```json
  {
    "id": "rpt_cj2mkA3hFyHT5",
    "type": "payments.created.current",
    "url": "https://production.methodfi.com/reports/rpt_cj2mkA3hFyHT5/download",
    "status": "completed",
    "metadata": null,
    "created_at": "2021-08-25T23:18:05.261Z",
    "updated_at": "2021-08-25T23:18:05.261Z"
  }
  ```
</ResponseExample>


# Request IDs



All API requests are identified by a request ID designed to ensure that every request and response is traceable and logged efficiently.
This ID is returned in the `Request-Id` header of the response. The request ID is useful for facilitating easy tracking and debugging of requests.

We highly recommend logging the request ID for every API request you make. If you need to contact support, providing the request ID will help us resolve your issue more quickly.

<RequestExample>
  ```bash cURL
  curl -i "https://production.methodfi.com/ping" \
    -H "Method-Version: 2024-04-04" \
    -H "Authorization: Bearer sk_WyZEWVfTcH7GqmPzUPk65Vjc"
  ```

  ```javascript Node.js
  import { Method } from 'method-node';

  const method_client = new Method({ apiKey, env });

  const health_check = await method_client.ping();

  console.log(health_check.last_response.request_id);
  ```

  ```python Python
  from method import Method

  method_client = Method({'api_key'=api_key, 'env'=env})

  health_check = client.ping()

  print(health_check.last_response.request_id)
  ```
</RequestExample>


# Simulate an Event

POST https://dev.methodfi.com/simulate/events

export const ParamList = ({items, is_child = false}) => {
  return items.map(item => {
    const field_props = {
      id: Math.random().toString(),
      body: item.name,
      name: item.name,
      type: item.type,
      required: item.required
    };
    const enums = item.enums || [];
    const items = item.items || [];
    const has_items = items?.length > 0;
    const has_enums = enums?.length > 0;
    const should_default_open = item.defaultOpen | false;
    const render_child_item = () => {
      const child_props = {
        title: has_enums ? "Possible enum values" : "properties"
      };
      if (should_default_open) child_props.defaultOpen = true;
      const has_inline_enums = has_enums && enums.every(enum_item => typeof enum_item === 'string') && enums.map((enum_item, idx) => {
        const is_last = idx === enums.length - 1;
        const is_2nd_to_last = idx === enums.length - 2;
        return <>
            <code>{enum_item}</code>
            {is_last && ''}
            {is_2nd_to_last && ' or '}
            {!is_last && !is_2nd_to_last && ', '}
          </>;
      });
      const enum_list = has_enums && !has_inline_enums && <Accordion {...child_props}>
          {enums.map(enum_item => <>
              <code>{enum_item.name}</code>
              <br />
              <p>{enum_item.description}</p>
            </>)}
        </Accordion>;
      const item_list = has_items && <Expandable {...child_props}>
          <ParamList items={items || []} is_child />
        </Expandable>;
      return <>
          <p>
            {item.description}
            {has_inline_enums && [has_inline_enums.length > 1 ? ' One of ' : ' Must be ', ...has_inline_enums]}
          </p>

          {enum_list}
          {item_list}
        </>;
    };
    return is_child ? <ResponseField {...field_props}>{render_child_item()}</ResponseField> : <ParamField {...field_props}>{render_child_item()}</ParamField>;
  });
};

Event simulation is available to test webhook handlers and event processing logic.

## Prerequisites

Some event types require specific endpoints to be called first:

*   `attribute.*` events: call `POST /entities/:ent_id/attributes` first
*   `credit_score.*` events: call `POST /entities/:ent_id/credit_scores` first
*   `account.opened` events: call `POST /entities/:ent_id/connect` first

## Request Body

### Entity Events

<ParamList
  items={[
  {
  name: 'type',
  type: 'string', 
  required: true,
  description: 'The type of event to simulate.',
  enums: ['attribute.*', 'credit_score.*', 'account.opened'],
  },
  {
  name: 'entity_id',
  type: 'string',
  required: true,
  description: 'ID of the Entity.',
  }
  ]}
/>

### Account Events

<ParamList
  items={[
  {
  name: 'type',
  type: 'string',
  required: true,
  description: 'The type of event to simulate.',
  enums: ['account.closed'],
  },
  {
  name: 'account_id', 
  type: 'string',
  required: true,
  description: 'ID of the Account.',
  },
  ]}
/>

<RequestExample>
  ```bash cURL
  curl https://dev.methodfi.com/simulate/events \
    -X POST \
    -H "Method-Version: 2024-04-04" \
    -H "Authorization: Bearer sk_WyZEWVfTcH7GqmPzUPk65Vjc" \
    -H "Content-Type: application/json" \
    -d '{
      "type": "credit_score.create",
      "entity_id": "ent_au22b1fbFJbp8"
    }'
  ```

  ```javascript Node.js
  const event = await method
    .simulate
    .events
    .create({
      type: "credit_score.create",
      entity_id: "ent_au22b1fbFJbp8"
    });
  ```

  ```python Python
  event = method.simulate.events.create({
    "type": "credit_score.create",
    "entity_id": "ent_au22b1fbFJbp8"
  })
  ```
</RequestExample>


# The simulate endpoint



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).

<Warning>
  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.
</Warning>

<Note>
  Simulation endpoints are prefixed with <code>/simulate</code> and will
  be in the following format where <code>RESOURCE\_NAME</code> refers any
  resource that supports simulations.
</Note>

<RequestExample>
  ```bash ENDPOINT STRUCTURE
  https://dev.methodfi.com/simulate/<RESOURCE_NAME>
  ```
</RequestExample>


# Update a Payment's Status

POST https://dev.methodfi.com/simulate/payments/{pmt_id}

export const ParamList = ({items, is_child = false}) => {
  return items.map(item => {
    const field_props = {
      id: Math.random().toString(),
      body: item.name,
      name: item.name,
      type: item.type,
      required: item.required
    };
    const enums = item.enums || [];
    const items = item.items || [];
    const has_items = items?.length > 0;
    const has_enums = enums?.length > 0;
    const should_default_open = item.defaultOpen | false;
    const render_child_item = () => {
      const child_props = {
        title: has_enums ? "Possible enum values" : "properties"
      };
      if (should_default_open) child_props.defaultOpen = true;
      const has_inline_enums = has_enums && enums.every(enum_item => typeof enum_item === 'string') && enums.map((enum_item, idx) => {
        const is_last = idx === enums.length - 1;
        const is_2nd_to_last = idx === enums.length - 2;
        return <>
            <code>{enum_item}</code>
            {is_last && ''}
            {is_2nd_to_last && ' or '}
            {!is_last && !is_2nd_to_last && ', '}
          </>;
      });
      const enum_list = has_enums && !has_inline_enums && <Accordion {...child_props}>
          {enums.map(enum_item => <>
              <code>{enum_item.name}</code>
              <br />
              <p>{enum_item.description}</p>
            </>)}
        </Accordion>;
      const item_list = has_items && <Expandable {...child_props}>
          <ParamList items={items || []} is_child />
        </Expandable>;
      return <>
          <p>
            {item.description}
            {has_inline_enums && [has_inline_enums.length > 1 ? ' One of ' : ' Must be ', ...has_inline_enums]}
          </p>

          {enum_list}
          {item_list}
        </>;
    };
    return is_child ? <ResponseField {...field_props}>{render_child_item()}</ResponseField> : <ParamField {...field_props}>{render_child_item()}</ParamField>;
  });
};

Updates a Payment's status.

## Path Parameters

<ParamList
  items={[
  {
  name: 'pmt_id',
  type: 'string',
  required: true,
  description: 'ID of the Payment',
  },
  ]}
/>

## Body

<ParamList
  items={[
  {
  name: 'status',
  type: 'enum',
  required: true,
  description: (
    <>
      The next status to which the Payment should transition.
      See <a href="/reference/payments/overview#payment-objects">Payment Statuses.</a>
    </>
  ),
  },
  {
  name: 'error_code',
  type: 'enum',
  required: false,
  description: (
    <>
      The desired Payment error code to simulate. Required when status
      is <code>failed</code>, or <code>reversal_processing</code>.
    </>
  ),
  enums: [
    { name: '10001', description: 'Insufficient funds error.' },
    { name: '10002', description: 'Unauthorized Payment error.' },
    { name: '10003', description: 'Invalid Account error.' },
    { name: '10005', description: 'Unauthorized Source error.' },
    { name: '10006', description: 'Unauthorized Destination error.' },
    { name: '10007', description: 'Invalid Source error.' },
    { name: '10008', description: 'Invalid Destination error.' },
    { name: '10009', description: 'Rejected By Destination error.' },
    { name: '10010', description: 'Invalid Amount error.' },
  ]
  }
  ]}
/>

## Returns

Returns a Payment object with the updated status.

<RequestExample>
  ```bash cURL
  curl https://dev.methodfi.com/simulate/payments/pmt_rPrDPEwyCVUcm \
    -X POST \
    -H "Method-Version: 2024-04-04" \
    -H "Authorization: Bearer sk_WyZEWVfTcH7GqmPzUPk65Vjc" \
    -H "Content-Type: application/json" \
    -d '{
      "status": "processing"
    }'
  ```

  ```javascript Node.js
  const payment = await method
    .simulate
    .payments
    .update('pmt_rPrDPEwyCVUcm', { status: 'processing' });
  ```

  ```python Python
  payment = method
    .simulate
    .payments
    .update('pmt_rPrDPEwyCVUcm', { 'status': 'processing' })
  ```
</RequestExample>

<ResponseExample>
  ```json
  {
    "id": "pmt_rPrDPEwyCVUcm",
    "reversal_id": null,
    "source_trace_id": null,
    "destination_trace_id": null,
    "source": "acc_JMJZT6r7iHi8e",
    "destination": "acc_AXthnzpBnxxWP",
    "amount": 5000,
    "description": "Loan Pmt",
    "status": "processing",
    "error": null,
    "metadata": null,
    "estimated_completion_date": "2020-12-11",
    "source_settlement_date": "2020-12-09",
    "destination_settlement_date": "2020-12-11",
    "fee": null,
    "created_at": "2020-12-09T00:42:31.209Z",
    "updated_at": "2020-12-09T00:43:30.996Z"
  }
  ```
</ResponseExample>


# Create a Transaction

POST https://dev.methodfi.com/simulate/accounts/{acc_id}/transactions

export const ParamList = ({items, is_child = false}) => {
  return items.map(item => {
    const field_props = {
      id: Math.random().toString(),
      body: item.name,
      name: item.name,
      type: item.type,
      required: item.required
    };
    const enums = item.enums || [];
    const items = item.items || [];
    const has_items = items?.length > 0;
    const has_enums = enums?.length > 0;
    const should_default_open = item.defaultOpen | false;
    const render_child_item = () => {
      const child_props = {
        title: has_enums ? "Possible enum values" : "properties"
      };
      if (should_default_open) child_props.defaultOpen = true;
      const has_inline_enums = has_enums && enums.every(enum_item => typeof enum_item === 'string') && enums.map((enum_item, idx) => {
        const is_last = idx === enums.length - 1;
        const is_2nd_to_last = idx === enums.length - 2;
        return <>
            <code>{enum_item}</code>
            {is_last && ''}
            {is_2nd_to_last && ' or '}
            {!is_last && !is_2nd_to_last && ', '}
          </>;
      });
      const enum_list = has_enums && !has_inline_enums && <Accordion {...child_props}>
          {enums.map(enum_item => <>
              <code>{enum_item.name}</code>
              <br />
              <p>{enum_item.description}</p>
            </>)}
        </Accordion>;
      const item_list = has_items && <Expandable {...child_props}>
          <ParamList items={items || []} is_child />
        </Expandable>;
      return <>
          <p>
            {item.description}
            {has_inline_enums && [has_inline_enums.length > 1 ? ' One of ' : ' Must be ', ...has_inline_enums]}
          </p>

          {enum_list}
          {item_list}
        </>;
    };
    return is_child ? <ResponseField {...field_props}>{render_child_item()}</ResponseField> : <ParamField {...field_props}>{render_child_item()}</ParamField>;
  });
};

Transaction simulation is available for Credit Card Accounts that have been verified and are subscribed to the Transactions product.

Simulating a Transaction will mimic a new transaction created by the credit card networks for a specific Account.

## Path Parameters

<ParamList
  items={[
  {
  name: 'acc_id',
  type: 'string',
  required: true,
  description: 'ID of the Account.',
  },
  ]}
/>

## Returns

Returns the Transaction object.

<RequestExample>
  ```bash cURL
  curl https://dev.methodfi.com/simulate/accounts/:acc_id/transactions \
    -X POST \
    -H "Method-Version: 2024-04-04" \
    -H "Authorization: Bearer sk_WyZEWVfTcH7GqmPzUPk65Vjc" \
    -H "Content-Type: application/json" \
    -d '{}'
  ```

  ```javascript Node.js
  const transaction = await method
    .simulate
    .accounts('acc_r6JUYN67HhCEM')
    .transactions
    .create();
  ```

  ```python Python
  transaction = method
    .simulate
    .accounts('acc_r6JUYN67HhCEM')
    .transactions
    .create()
  ```
</RequestExample>

<ResponseExample>
  ```json
  {
    "id": "txn_ydx4UUQcyJALz",
    "account_id": "acc_r6JUYN67HhCEM",
    "merchant": {
      "name": "SILVER MNT EATERY SS",
      "category_code": "5812",
      "city": "Austin",
      "state": "TX",
      "country": "USA",
    },
    "network": "visa",
    "network_data": null,
    "amount": 18894,
    "currency": "USD",
    "billing_amount": 18894,
    "billing_currency": "USD",
    "status": "auth",
    "error": null,
    "created_at": "2024-03-11T16:53:23.109Z",
    "updated_at": "2024-03-11T16:53:23.109Z"
  }
  ```
</ResponseExample>


# Versioning



#### API Versioning

When updates are incompatible with previous versions (backwards-incompatible), a new, dated version of the API is released. The current version is: `2024-04-04`

API versions are specified using the `Method-Version` header, and while you may continue using older versions, you will not have access to the latest features.

You can upgrade to the latest or a specific version through the [Dashboard](https://dashboard.methodfi.com), or by specifying the version in request headers. Note that once upgraded manually, it's not possible to revert to older versions.

#### Library Versioning

For Method Libraries, the version is locked to the dated version of the API. For example, `method-node v0.x.x` is locked to `2020-12-06`, while `method-node v1.x.x` is locked to `2024-04-04` and onwards.

For detailed version histories, refer to our [Changelog](/changelog).

<RequestExample>
  ```bash cURL
  curl "https://production.methodfi.com/payments?page_limit=1&to_date=2020-12-10" \
    -H "Method-Version: 2024-04-04" \
    -H "Authorization: Bearer sk_WyZEWVfTcH7GqmPzUPk65Vjc"
  ```
</RequestExample>


# Create a Webhook

POST /webhooks

export const ParamList = ({items, is_child = false}) => {
  return items.map(item => {
    const field_props = {
      id: Math.random().toString(),
      body: item.name,
      name: item.name,
      type: item.type,
      required: item.required
    };
    const enums = item.enums || [];
    const items = item.items || [];
    const has_items = items?.length > 0;
    const has_enums = enums?.length > 0;
    const should_default_open = item.defaultOpen | false;
    const render_child_item = () => {
      const child_props = {
        title: has_enums ? "Possible enum values" : "properties"
      };
      if (should_default_open) child_props.defaultOpen = true;
      const has_inline_enums = has_enums && enums.every(enum_item => typeof enum_item === 'string') && enums.map((enum_item, idx) => {
        const is_last = idx === enums.length - 1;
        const is_2nd_to_last = idx === enums.length - 2;
        return <>
            <code>{enum_item}</code>
            {is_last && ''}
            {is_2nd_to_last && ' or '}
            {!is_last && !is_2nd_to_last && ', '}
          </>;
      });
      const enum_list = has_enums && !has_inline_enums && <Accordion {...child_props}>
          {enums.map(enum_item => <>
              <code>{enum_item.name}</code>
              <br />
              <p>{enum_item.description}</p>
            </>)}
        </Accordion>;
      const item_list = has_items && <Expandable {...child_props}>
          <ParamList items={items || []} is_child />
        </Expandable>;
      return <>
          <p>
            {item.description}
            {has_inline_enums && [has_inline_enums.length > 1 ? ' One of ' : ' Must be ', ...has_inline_enums]}
          </p>

          {enum_list}
          {item_list}
        </>;
    };
    return is_child ? <ResponseField {...field_props}>{render_child_item()}</ResponseField> : <ParamField {...field_props}>{render_child_item()}</ParamField>;
  });
};

Creating a new Webhook means registering a URL to receive
updates for a specific event type. Once a resource is
created or updated, your application will be notified
via an HTTPS POST request with the event information.

## Body

<ParamList
  items={[
  {
  name: 'type',
  type: 'enum',
  required: true,
  description: (
    <>
      The event type to be sent to this
      URL. See <a href="/reference/webhooks/overview#webhook-event-types">Webhook Event Types.</a>
    </>
  ),
  },
  {
  name: 'url',
  type: 'string',
  required: true,
  description: (
    <>
      The URL receiving the Webhook event.

      <Tip>
        When testing your integration in a local environment, we recommend
        utilizing the following technologies for a seamless developer experience
        with Webhooks:
        <br/>
        <ul>
          <li>
            <a href="https://webhook.site" target="_blank">https://webhook.site</a> – to debug
            the Webhook payload from Method.
          </li>
          <li>
            <a href="https://ngrok.com" target="_blank">https://ngrok.com</a> – to create a reverse
            proxy to your local development environment.
          </li>
        </ul>
      </Tip>
    </>
  ),
  },
  {
  name: 'auth_token',
  type: 'string',
  required: false,
  description: (
    <>
      Secret token for request validation. Will be sent as
      a <code>base64</code> encoded string in
      the <code>Authorization</code> header of the Webhook.

      This can be used by your application to ensure the integrity of
      incoming Webhook events.
    </>
  ),
  },
  {
  name: 'expand_event',
  type: 'boolean',
  required: false,
  description: (
    <>
      Whether to expand the event object in the Webhook payload. (default: false)
    </>
  ),
  }
  ]}
/>

## Returns

Returns the newly created Webhook object.

<RequestExample>
  ```bash cURL
  curl https://production.methodfi.com/webhooks \
    -X POST \
    -H "Method-Version: 2024-04-04" \
    -H "Authorization: Bearer sk_WyZEWVfTcH7GqmPzUPk65Vjc" \
    -H "Content-Type: application/json" \
    -d '{
      "type": "payment.update",
      "url": "https://reference.example.app/webhook",
      "auth_token": "md7UqcTSmvXCBzPORDwOkE",
      "expand_event": true
    }'
  ```

  ```javascript Node.js
  const webhook = await method.webhooks.create({
    type: 'payment.update',
    url: 'https://reference.example.app/webhook',
    auth_token: 'md7UqcTSmvXCBzPORDwOkE',
    expand_event: true
  });
  ```

  ```python Python
  webhook = method.webhooks.create({
    'type': 'payment.update',
    'url': 'https://reference.example.app/webhook',
    'auth_token': 'md7UqcTSmvXCBzPORDwOkE',
    'expand_event': true
  })
  ```
</RequestExample>

<ResponseExample>
  ```json
  {
    "id": "whk_cSGjA6d9N8y8R",
    "type": "payment.update",
    "url": "https://reference.example.app/webhook",
    "metadata": null,
    "expand_event": false,
    "status": "active",
    "error": null,
    "created_at": "2020-12-09T00:41:05.647Z",
    "updated_at": "2020-12-09T00:41:05.647Z",
  }
  ```
</ResponseExample>


# Delete a Webhook

DELETE /webhooks/{whk_id}

export const ParamList = ({items, is_child = false}) => {
  return items.map(item => {
    const field_props = {
      id: Math.random().toString(),
      body: item.name,
      name: item.name,
      type: item.type,
      required: item.required
    };
    const enums = item.enums || [];
    const items = item.items || [];
    const has_items = items?.length > 0;
    const has_enums = enums?.length > 0;
    const should_default_open = item.defaultOpen | false;
    const render_child_item = () => {
      const child_props = {
        title: has_enums ? "Possible enum values" : "properties"
      };
      if (should_default_open) child_props.defaultOpen = true;
      const has_inline_enums = has_enums && enums.every(enum_item => typeof enum_item === 'string') && enums.map((enum_item, idx) => {
        const is_last = idx === enums.length - 1;
        const is_2nd_to_last = idx === enums.length - 2;
        return <>
            <code>{enum_item}</code>
            {is_last && ''}
            {is_2nd_to_last && ' or '}
            {!is_last && !is_2nd_to_last && ', '}
          </>;
      });
      const enum_list = has_enums && !has_inline_enums && <Accordion {...child_props}>
          {enums.map(enum_item => <>
              <code>{enum_item.name}</code>
              <br />
              <p>{enum_item.description}</p>
            </>)}
        </Accordion>;
      const item_list = has_items && <Expandable {...child_props}>
          <ParamList items={items || []} is_child />
        </Expandable>;
      return <>
          <p>
            {item.description}
            {has_inline_enums && [has_inline_enums.length > 1 ? ' One of ' : ' Must be ', ...has_inline_enums]}
          </p>

          {enum_list}
          {item_list}
        </>;
    };
    return is_child ? <ResponseField {...field_props}>{render_child_item()}</ResponseField> : <ParamField {...field_props}>{render_child_item()}</ParamField>;
  });
};

Deletes the Webhook associated with the ID.

## Path Parameters

<ParamList
  items={[
  {
  name: 'whk_id',
  type: 'string',
  description: 'The ID of the Webhook to delete',
  },
  ]}
/>

## Returns

Returns `200` with an empty object on success.

<RequestExample>
  ```bash cURL
  curl https://production.methodfi.com/webhooks/whk_cSGjA6d9N8y8R \
    -X DELETE \
    -H "Method-Version: 2024-04-04" \
    -H "Authorization: Bearer sk_WyZEWVfTcH7GqmPzUPk65Vjc"
  ```

  ```javascript Node.js
  const webhook = await method.webhooks.delete('whk_cSGjA6d9N8y8R');
  ```

  ```python Python
  webhook = method.webhooks.delete('whk_cSGjA6d9N8y8R')
  ```
</RequestExample>


# List all Webhook

GET /webhooks

export const ParamList = ({items, is_child = false}) => {
  return items.map(item => {
    const field_props = {
      id: Math.random().toString(),
      body: item.name,
      name: item.name,
      type: item.type,
      required: item.required
    };
    const enums = item.enums || [];
    const items = item.items || [];
    const has_items = items?.length > 0;
    const has_enums = enums?.length > 0;
    const should_default_open = item.defaultOpen | false;
    const render_child_item = () => {
      const child_props = {
        title: has_enums ? "Possible enum values" : "properties"
      };
      if (should_default_open) child_props.defaultOpen = true;
      const has_inline_enums = has_enums && enums.every(enum_item => typeof enum_item === 'string') && enums.map((enum_item, idx) => {
        const is_last = idx === enums.length - 1;
        const is_2nd_to_last = idx === enums.length - 2;
        return <>
            <code>{enum_item}</code>
            {is_last && ''}
            {is_2nd_to_last && ' or '}
            {!is_last && !is_2nd_to_last && ', '}
          </>;
      });
      const enum_list = has_enums && !has_inline_enums && <Accordion {...child_props}>
          {enums.map(enum_item => <>
              <code>{enum_item.name}</code>
              <br />
              <p>{enum_item.description}</p>
            </>)}
        </Accordion>;
      const item_list = has_items && <Expandable {...child_props}>
          <ParamList items={items || []} is_child />
        </Expandable>;
      return <>
          <p>
            {item.description}
            {has_inline_enums && [has_inline_enums.length > 1 ? ' One of ' : ' Must be ', ...has_inline_enums]}
          </p>

          {enum_list}
          {item_list}
        </>;
    };
    return is_child ? <ResponseField {...field_props}>{render_child_item()}</ResponseField> : <ParamField {...field_props}>{render_child_item()}</ParamField>;
  });
};

Returns all the Webhooks associated with your team,
or an empty array if none have been created.

## Path Parameters

<ParamList items={[{ name: 'No Parameters' }]} />

## Returns

Returns a list of Webhook objects.

<RequestExample>
  ```bash cURL
  curl https://production.methodfi.com/webhooks \
    -H "Method-Version: 2024-04-04" \
    -H "Authorization: Bearer sk_WyZEWVfTcH7GqmPzUPk65Vjc"
  ```

  ```javascript Node.js
  const webhooks = await method.webhooks.list();
  ```

  ```python Python
  webhooks = method.webhooks.list()
  ```
</RequestExample>

<ResponseExample>
  ```json
  {
    "data": [
      {
        "id": "whk_cSGjA6d9N8y8R",
        "type": "payment.update",
        "url": "https://reference.example.app/webhook",
        "metadata": null,
        "expanded_event": false,
        "status": "active",
        "error": null,
        "created_at": "2022-03-31T17:56:55.757Z",
        "updated_at": "2022-03-31T17:56:55.757Z",
      },
    ]
  }
  ```
</ResponseExample>


# The webhook endpoint



export const get_common_parameters = (resource_name = 'resource') => {
  return {
    id: {
      name: 'id',
      type: "string",
      required: false,
      description: `Unique identifier for the ${resource_name}.`
    },
    entity_id: {
      name: 'entity_id',
      type: 'string',
      required: false,
      description: 'The ID of the associated Entity.'
    },
    account_id: {
      name: 'account_id',
      type: 'string',
      required: false,
      description: 'The ID of the associated Account.'
    },
    error: {
      name: 'error',
      type: 'object | null',
      required: false,
      description: <>
          An object representing an error that occurred while processing
          this {resource_name}. See <a href={`/reference/errors/${resource_name.replace(/^([A-Z])/, function (match) {
        return match.toLowerCase();
      }).replace(/([A-Z])/g, function (match) {
        return "-" + match.toLowerCase();
      })}-errors`}>{resource_name} errors</a>.
        </>
    },
    status_error: {
      name: 'status_error',
      type: 'object | null',
      required: false,
      description: <>
          An object representing an error that occurred while processing
          this {resource_name}. See <a href="/reference/errors/product-errors#status-errors">{resource_name} errors</a>.
        </>
    },
    metadata: {
      name: 'metadata',
      type: 'object | null',
      required: false,
      description: <>
          Additional data provided during creation.
          See <a href="/reference/metadata">metadata</a>
        </>
    },
    created_at: {
      name: 'created_at',
      type: 'string',
      required: false,
      description: `Timestamp of when the ${resource_name} was created.`
    },
    updated_at: {
      name: 'updated_at',
      type: 'string',
      required: false,
      description: `Timestamp of when the ${resource_name} was last updated.`
    },
    status: (enums = []) => ({
      name: 'status',
      type: 'enum',
      required: false,
      description: `Status of the ${resource_name}.`,
      enums
    }),
    type: (enums = []) => ({
      name: 'type',
      type: 'enum',
      required: false,
      description: `The type of ${resource_name}.`,
      enums
    })
  };
};

export const ParamList = ({items, is_child = false}) => {
  return items.map(item => {
    const field_props = {
      id: Math.random().toString(),
      body: item.name,
      name: item.name,
      type: item.type,
      required: item.required
    };
    const enums = item.enums || [];
    const items = item.items || [];
    const has_items = items?.length > 0;
    const has_enums = enums?.length > 0;
    const should_default_open = item.defaultOpen | false;
    const render_child_item = () => {
      const child_props = {
        title: has_enums ? "Possible enum values" : "properties"
      };
      if (should_default_open) child_props.defaultOpen = true;
      const has_inline_enums = has_enums && enums.every(enum_item => typeof enum_item === 'string') && enums.map((enum_item, idx) => {
        const is_last = idx === enums.length - 1;
        const is_2nd_to_last = idx === enums.length - 2;
        return <>
            <code>{enum_item}</code>
            {is_last && ''}
            {is_2nd_to_last && ' or '}
            {!is_last && !is_2nd_to_last && ', '}
          </>;
      });
      const enum_list = has_enums && !has_inline_enums && <Accordion {...child_props}>
          {enums.map(enum_item => <>
              <code>{enum_item.name}</code>
              <br />
              <p>{enum_item.description}</p>
            </>)}
        </Accordion>;
      const item_list = has_items && <Expandable {...child_props}>
          <ParamList items={items || []} is_child />
        </Expandable>;
      return <>
          <p>
            {item.description}
            {has_inline_enums && [has_inline_enums.length > 1 ? ' One of ' : ' Must be ', ...has_inline_enums]}
          </p>

          {enum_list}
          {item_list}
        </>;
    };
    return is_child ? <ResponseField {...field_props}>{render_child_item()}</ResponseField> : <ParamField {...field_props}>{render_child_item()}</ParamField>;
  });
};

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.

<Warning>
  Webhooks that consistently fail to respond with a 200 will automatically be
  disabled.
</Warning>

## Webhook Objects

<ParamList
  items={[
  get_common_parameters("Webhook").id,
  {
    name: "type",
    type: "enum",
    description: (
      <>
        The event type to be sent to this URL. See{" "}
        <a href="/reference/webhooks/overview#webhook-event-types">Webhook Event Types.</a>
      </>
    ),
  },
  {
    name: "url",
    type: "string",
    description: "The URL receiving the webhook event.",
  },
  get_common_parameters("Webhook").metadata,
  {
    name: 'expand_event',
    type: 'boolean',
    description: (
      <>
        Whether to expand the event object in the Webhook payload. (default: false)
      </>
    ),
  },
  {
    name: "status",
    type: "enum",
    description: (
      <>
        Whether webhook is 'active' or 'disabled'.
      </>
    ),
  },
  get_common_parameters("Webhook").error,
  get_common_parameters("Webhook").created_at,
  get_common_parameters("Webhook").updated_at,
  ]}
/>

## Webhook event object

<ParamList
  items={[
  {
    name: "id",
    type: "string",
    description: "The identifier of the resource modified.",
  },
  {
    name: "type",
    type: "string",
    description: (
      <>
        The event type. See{" "}
        <a href="/reference/webhooks/overview#webhook-event-types">Webhook Event Types.</a>
      </>
    ),
  },
  {
    name: "path",
    type: "string",
    description: (
      <>
        The URL path pointing to the affected resource. Make a HTTP GET
        request to this path to retrieve the resource.
      </>
    ),
  },
  ]}
/>

#### Webhook Event Types

| Name                                                  | Description                                                |
| ----------------------------------------------------- | ---------------------------------------------------------- |
| `account.create`                                      | A new Account was successfully created.                    |
| `account.update`                                      | An Account has been updated.                               |
| `account.opened`                                      | An Account has been opened.                                |
| `account.closed`                                      | An Account has been closed.                                |
| `sensitive.create`                                    | A new Sensitive was successfully created.                  |
| `sensitive.update`                                    | An Sensitive has been updated.                             |
| `account_verification_session.create`                 | A new AccountVerificationSession was successfully created. |
| `account_verification_session.update`                 | An AccountVerificationSession has been updated.            |
| `balance.create`                                      | A new Balance was successfully created.                    |
| `balance.update`                                      | A Balance has been updated.                                |
| `card_brand.create`                                   | A new CardBrand was successfully created.                  |
| `card_brand.update`                                   | A CardBrand has been updated.                              |
| `connect.create`                                      | A new Connect was successfully created.                    |
| `connect.update`                                      | A Connect has been updated.                                |
| `credit_score.create`                                 | A new CreditScore was successfully created.                |
| `credit_score.update`                                 | A CreditScore has been updated.                            |
| `entity.create`                                       | A new Entity was successfully created.                     |
| `entity.update`                                       | An Entity has been updated.                                |
| `entity_verification_session.create`                  | A new EntityVerificationSession was successfully created.  |
| `entity_verification_session.update`                  | An EntityVerificationSession has been updated.             |
| `identity.create`                                     | A new Identity was successfully created.                   |
| `identity.update`                                     | An Identity has been updated.                              |
| `payment.create`                                      | A new Payment was successfully created.                    |
| `payment.update`                                      | A Payment has been updated.                                |
| `payment_reversal.create`                             | A new PaymentReversal was successfully created.            |
| `payment_reversal.update`                             | A PaymentReversal has been updated.                        |
| `payoff.create`                                       | A new Payoff was successfully created.                     |
| `payoff.update`                                       | A Payoff has been updated.                                 |
| `product.create`                                      | A new Product was successfully created.                    |
| `product.update`                                      | A Product has been updated.                                |
| `report.create`                                       | A new Report was successfully created.                     |
| `report.update`                                       | A Report has been updated.                                 |
| `subscription.create`                                 | A new Subscription was successfully created.               |
| `subscription.update`                                 | A Subscription has been updated.                           |
| `transaction.create`                                  | A new Transaction was successfully created.                |
| `transaction.update`                                  | A Transaction has been updated.                            |
| `update.create`                                       | A new Update was successfully created.                     |
| `update.update`                                       | An Update has been updated.                                |
| `credit_score.increased`                              | A user's credit score has increased.                       |
| `credit_score.decreased`                              | A user's credit score has decreased.                       |
| `attribute.credit_health_credit_card_usage.increased` | Credit card usage has increased.                           |
| `attribute.credit_health_credit_card_usage.decreased` | Credit card usage has decreased.                           |
| `attribute.credit_health_derogatory_marks.increased`  | Number of derogatory marks increased.                      |
| `attribute.credit_health_derogatory_marks.decreased`  | Number of derogatory marks decreased.                      |
| `attribute.credit_health_hard_inquiries.increased`    | Number of hard inquiries increased.                        |
| `attribute.credit_health_hard_inquiries.decreased`    | Number of hard inquiries decreased.                        |
| `attribute.credit_health_total_accounts.increased`    | Total number of accounts increased.                        |
| `attribute.credit_health_total_accounts.decreased`    | Total number of accounts decreased.                        |
| `attribute.credit_health_credit_age.increased`        | Credit age has increased.                                  |
| `attribute.credit_health_credit_age.decreased`        | Credit age has decreased.                                  |
| `attribute.credit_health_payment_history.increased`   | Payment history score has improved.                        |
| `attribute.credit_health_payment_history.decreased`   | Payment history score has decreased.                       |

<RequestExample>
  ```json THE WEBHOOK OBJECT
  {
    "id": "whk_cSGjA6d9N8y8R",
    "type": "payment.update",
    "url": "https://reference.example.app/webhook",
    "metadata": null,
    "expanded_event": false,
    "status": "active",
    "error": null,
    "created_at": "2020-12-09T00:41:05.647Z",
    "updated_at": "2020-12-09T00:41:05.647Z"
  }
  ```
</RequestExample>

<ResponseExample>
  ```json WEBHOOK EVENT OBJECT
  {
    "id": "pmt_zR3nJG3c99P3X"
    "type": "payment.update",
    "path": "/payments/pmt_zR3nJG3c99P3X",
    "event": "evt_knqJgxKUnqDVJ"
  }
  ```
</ResponseExample>


# Retrieve a Webhook

GET /webhooks/{whk_id}

export const ParamList = ({items, is_child = false}) => {
  return items.map(item => {
    const field_props = {
      id: Math.random().toString(),
      body: item.name,
      name: item.name,
      type: item.type,
      required: item.required
    };
    const enums = item.enums || [];
    const items = item.items || [];
    const has_items = items?.length > 0;
    const has_enums = enums?.length > 0;
    const should_default_open = item.defaultOpen | false;
    const render_child_item = () => {
      const child_props = {
        title: has_enums ? "Possible enum values" : "properties"
      };
      if (should_default_open) child_props.defaultOpen = true;
      const has_inline_enums = has_enums && enums.every(enum_item => typeof enum_item === 'string') && enums.map((enum_item, idx) => {
        const is_last = idx === enums.length - 1;
        const is_2nd_to_last = idx === enums.length - 2;
        return <>
            <code>{enum_item}</code>
            {is_last && ''}
            {is_2nd_to_last && ' or '}
            {!is_last && !is_2nd_to_last && ', '}
          </>;
      });
      const enum_list = has_enums && !has_inline_enums && <Accordion {...child_props}>
          {enums.map(enum_item => <>
              <code>{enum_item.name}</code>
              <br />
              <p>{enum_item.description}</p>
            </>)}
        </Accordion>;
      const item_list = has_items && <Expandable {...child_props}>
          <ParamList items={items || []} is_child />
        </Expandable>;
      return <>
          <p>
            {item.description}
            {has_inline_enums && [has_inline_enums.length > 1 ? ' One of ' : ' Must be ', ...has_inline_enums]}
          </p>

          {enum_list}
          {item_list}
        </>;
    };
    return is_child ? <ResponseField {...field_props}>{render_child_item()}</ResponseField> : <ParamField {...field_props}>{render_child_item()}</ParamField>;
  });
};

Returns the Webhook object associated with the ID.

## Path Parameters

<ParamList
  items={[
  {
  name: 'whk_id',
  type: 'string',
  required: true,
  description: 'ID of the Webhook',
  },
  ]}
/>

## Returns

Returns the Webhook object associated with the ID.

<RequestExample>
  ```bash cURL
  curl https://production.methodfi.com/webhooks/whk_cSGjA6d9N8y8R \
    -H "Method-Version: 2024-04-04" \
    -H "Authorization: Bearer sk_WyZEWVfTcH7GqmPzUPk65Vjc"
  ```

  ```javascript Node.js
  const webhook = await method.webhooks.retrieve('whk_cSGjA6d9N8y8R');
  ```

  ```python Python
  webhook = method.webhooks.retrieve('whk_cSGjA6d9N8y8R')
  ```
</RequestExample>

<ResponseExample>
  ```json
  {
    "id": "whk_cSGjA6d9N8y8R",
    "type": "payment.update",
    "url": "https://reference.example.app/webhook",
    "metadata": null,
    "expanded_event": false,
    "status": "active",
    "error": null,
    "created_at": "2020-12-09T00:41:05.647Z",
    "updated_at": "2020-12-09T00:41:05.647Z",
  }
  ```
</ResponseExample>