Skip to content

Latest commit

 

History

History
10837 lines (7642 loc) · 148 KB

reference.md

File metadata and controls

10837 lines (7642 loc) · 148 KB

Reference

EntityGroup

client.entity_group.get_all(...)

📝 Description

Get all entity groups. If using a JWT, will return all groups the entity is part of. If using an API key, will return all groups for the organization.

🔌 Usage

from mercoa.client import Mercoa

client = Mercoa(
    token="YOUR_TOKEN",
)
client.entity_group.get_all()

⚙️ Parameters

limit: typing.Optional[int] — The maximum number of results to return. Defaults to 1. Max is 10.

starting_after: typing.Optional[EntityGroupId]

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.entity_group.create(...)

📝 Description

Create an entity group

🔌 Usage

from mercoa import EntityGroupRequest
from mercoa.client import Mercoa

client = Mercoa(
    token="YOUR_TOKEN",
)
client.entity_group.create(
    request=EntityGroupRequest(
        entity_ids=[
            "ent_8545a84e-a45f-41bf-bdf1-33b42a55812c",
            "ent_21661ac1-a2a8-4465-a6c0-64474ba8181d",
        ],
    ),
)

⚙️ Parameters

request: EntityGroupRequest

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.entity_group.get(...)

📝 Description

Get an entity group

🔌 Usage

from mercoa.client import Mercoa

client = Mercoa(
    token="YOUR_TOKEN",
)
client.entity_group.get(
    entity_group_id="entg_a3582b70-fd04-4888-9185-a640ae9048be",
)

⚙️ Parameters

entity_group_id: EntityGroupId

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.entity_group.update(...)

📝 Description

Update an entity group

🔌 Usage

from mercoa import EntityGroupRequest
from mercoa.client import Mercoa

client = Mercoa(
    token="YOUR_TOKEN",
)
client.entity_group.update(
    entity_group_id="entg_a3582b70-fd04-4888-9185-a640ae9048be",
    request=EntityGroupRequest(
        entity_ids=[
            "ent_8545a84e-a45f-41bf-bdf1-33b42a55812c",
            "ent_21661ac1-a2a8-4465-a6c0-64474ba8181d",
        ],
    ),
)

⚙️ Parameters

entity_group_id: EntityGroupId

request: EntityGroupRequest

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.entity_group.delete(...)

📝 Description

Delete an entity group

🔌 Usage

from mercoa.client import Mercoa

client = Mercoa(
    token="YOUR_TOKEN",
)
client.entity_group.delete(
    entity_group_id="string",
)

⚙️ Parameters

entity_group_id: EntityGroupId

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

EntityGroup User

client.entity_group.user.find(...)

📝 Description

Search entity group users

🔌 Usage

from mercoa.client import Mercoa

client = Mercoa(
    token="YOUR_TOKEN",
)
client.entity_group.user.find(
    entity_group_id="entg_8545a84e-a45f-41bf-bdf1-33b42a55812c",
    name="John",
)

⚙️ Parameters

entity_group_id: EntityGroupId — Entity Group ID

foreign_id: typing.Optional[typing.Union[str, typing.Sequence[str]]] — ID used to identify user in your system

role: typing.Optional[typing.Union[str, typing.Sequence[str]]] — Filter users by role. If multiple roles are provided, users with any of the roles will be returned.

name: typing.Optional[str] — Filter users by name. Partial matches are supported.

email: typing.Optional[str] — Filter users by email. Partial matches are supported.

limit: typing.Optional[int] — Number of entities to return. Limit can range between 1 and 100, and the default is 10.

starting_after: typing.Optional[EntityUserId] — The ID of the user to start after. If not provided, the first page of entities will be returned.

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.entity_group.user.create(...)

📝 Description

Create entity user that will be added to all entities in the group.

🔌 Usage

from mercoa import EntityGroupUserEntityRequest, EntityGroupUserRequest
from mercoa.client import Mercoa

client = Mercoa(
    token="YOUR_TOKEN",
)
client.entity_group.user.create(
    entity_group_id="entg_8545a84e-a45f-41bf-bdf1-33b42a55812c",
    request=EntityGroupUserRequest(
        foreign_id="MY-DB-ID-12345",
        email="john.doe@acme.com",
        name="John Doe",
        entities=[
            EntityGroupUserEntityRequest(
                roles=["admin", "approver"],
                entity_id="ent_21661ac1-a2a8-4465-a6c0-64474ba8181d",
            ),
            EntityGroupUserEntityRequest(
                roles=["viewer"],
                entity_id="ent_574s93r-3943-fu39-g9dfr-33b42a55812c",
            ),
        ],
    ),
)

⚙️ Parameters

entity_group_id: EntityGroupId — Entity Group ID

request: EntityGroupUserRequest

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.entity_group.user.get(...)

📝 Description

Get entity user from a group

🔌 Usage

from mercoa.client import Mercoa

client = Mercoa(
    token="YOUR_TOKEN",
)
client.entity_group.user.get(
    entity_group_id="entg_8545a84e-a45f-41bf-bdf1-33b42a55812c",
    foreign_id="MY-DB-ID-12345",
)

⚙️ Parameters

entity_group_id: EntityGroupId — Entity Group ID

foreign_id: str — ID used to identify user in your system

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.entity_group.user.update(...)

📝 Description

Update entity user for all entities in the group.

🔌 Usage

from mercoa import EntityGroupUserEntityRequest, EntityGroupUserRequest
from mercoa.client import Mercoa

client = Mercoa(
    token="YOUR_TOKEN",
)
client.entity_group.user.update(
    entity_group_id="entg_8545a84e-a45f-41bf-bdf1-33b42a55812c",
    foreign_id="MY-DB-ID-12345",
    request=EntityGroupUserRequest(
        foreign_id="MY-DB-ID-12345",
        email="john.doe@acme.com",
        name="John Doe",
        entities=[
            EntityGroupUserEntityRequest(
                roles=["admin", "approver"],
                entity_id="ent_21661ac1-a2a8-4465-a6c0-64474ba8181d",
            ),
            EntityGroupUserEntityRequest(
                roles=["viewer"],
                entity_id="ent_574s93r-3943-fu39-g9dfr-33b42a55812c",
            ),
        ],
    ),
)

⚙️ Parameters

entity_group_id: EntityGroupId — Entity Group ID

foreign_id: str — ID used to identify user in your system

request: EntityGroupUserRequest

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.entity_group.user.delete(...)

📝 Description

Delete entity user from all entities in the group. This will also remove the user from all approval policies. If an approval policy will break as a result of this operation, this request will fail.

🔌 Usage

from mercoa.client import Mercoa

client = Mercoa(
    token="YOUR_TOKEN",
)
client.entity_group.user.delete(
    entity_group_id="string",
    foreign_id="string",
)

⚙️ Parameters

entity_group_id: EntityGroupId — Entity Group ID

foreign_id: str — ID used to identify user in your system

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

Entity

client.entity.find(...)

📝 Description

Search all entities with the given filters. If no filters are provided, all entities will be returned.

🔌 Usage

from mercoa.client import Mercoa

client = Mercoa(
    token="YOUR_TOKEN",
)
client.entity.find(
    is_customer=True,
    foreign_id="MY-DB-ID-12345",
    payment_methods=True,
)

⚙️ Parameters

payment_methods: typing.Optional[bool] — If true, will include entity payment methods as part of the response

is_customer: typing.Optional[bool] — If true, only entities with a direct relationship to the requesting organization will be returned. If false or not provided, all entities will be returned.

foreign_id: typing.Optional[typing.Union[str, typing.Sequence[str]]] — ID used to identify this entity in your system

status: typing.Optional[typing.Union[EntityStatus, typing.Sequence[EntityStatus]]]

is_payee: typing.Optional[bool]

If true, entities that are marked as payees will be returned. If false or not provided, entities that are marked as payees will not be returned.

is_payor: typing.Optional[bool]

If true or not provided, entities that are marked as payors will be returned. If false, entities that are marked as payors will not be returned.

name: typing.Optional[str] — Filter entities by name. Partial matches are supported.

limit: typing.Optional[int] — Number of entities to return. Limit can range between 1 and 100, and the default is 10.

starting_after: typing.Optional[EntityId] — The ID of the entity to start after. If not provided, the first page of entities will be returned.

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.entity.create(...)

🔌 Usage

from mercoa import BusinessProfileRequest, EntityRequest, ProfileRequest
from mercoa.client import Mercoa

client = Mercoa(
    token="YOUR_TOKEN",
)
client.entity.create(
    request=EntityRequest(
        is_customer=False,
        is_payor=False,
        is_payee=True,
        account_type="business",
        foreign_id="MY-DB-ID-90909",
        profile=ProfileRequest(
            business=BusinessProfileRequest(
                email="vendor@bigboxstore.com",
                legal_business_name="Big Box Store",
                website="http://www.bigboxstore.com",
                business_type="publicCorporation",
            ),
        ),
    ),
)

⚙️ Parameters

request: EntityRequest

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.entity.get(...)

🔌 Usage

from mercoa.client import Mercoa

client = Mercoa(
    token="YOUR_TOKEN",
)
client.entity.get(
    entity_id="ent_a0f6ea94-0761-4a5e-a416-3c453cb7eced",
)

⚙️ Parameters

entity_id: EntityId — Entity ID or Entity ForeignID

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.entity.update(...)

🔌 Usage

from mercoa import (
    Address,
    BusinessProfileRequest,
    Ein,
    EntityUpdateRequest,
    PhoneNumber,
    ProfileRequest,
    TaxId,
)
from mercoa.client import Mercoa

client = Mercoa(
    token="YOUR_TOKEN",
)
client.entity.update(
    entity_id="ent_a0f6ea94-0761-4a5e-a416-3c453cb7eced",
    request=EntityUpdateRequest(
        is_customer=True,
        is_payor=True,
        is_payee=False,
        account_type="business",
        foreign_id="MY-DB-ID-12345",
        profile=ProfileRequest(
            business=BusinessProfileRequest(
                email="customer@acme.com",
                legal_business_name="Acme Inc.",
                website="http://www.acme.com",
                business_type="llc",
                phone=PhoneNumber(
                    country_code="1",
                    number="4155551234",
                ),
                address=Address(
                    address_line_1="123 Main St",
                    address_line_2="Unit 1",
                    city="San Francisco",
                    state_or_province="CA",
                    postal_code="94105",
                    country="US",
                ),
                tax_id=TaxId(
                    ein=Ein(
                        number="12-3456789",
                    ),
                ),
            ),
        ),
    ),
)

⚙️ Parameters

entity_id: EntityId — Entity ID or Entity ForeignID

request: EntityUpdateRequest

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.entity.delete(...)

📝 Description

Will archive the entity. This action cannot be undone, and the entity will no longer be available for use. The foreignId on the entity will be cleared as well.

🔌 Usage

from mercoa.client import Mercoa

client = Mercoa(
    token="YOUR_TOKEN",
)
client.entity.delete(
    entity_id="string",
)

⚙️ Parameters

entity_id: EntityId — Entity ID or Entity ForeignID

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.entity.accept_terms_of_service(...)

📝 Description

This endpoint is used to indicate acceptance of Mercoa's terms of service for an entity. Send a request to this endpoint only after the entity has accepted the Mercoa ToS. Entities must accept Mercoa ToS before they can be send or pay invoices using Mercoa's payment rails.

🔌 Usage

from mercoa.client import Mercoa

client = Mercoa(
    token="YOUR_TOKEN",
)
client.entity.accept_terms_of_service(
    entity_id="ent_a0f6ea94-0761-4a5e-a416-3c453cb7eced",
)

⚙️ Parameters

entity_id: EntityId — Entity ID or Entity ForeignID

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.entity.initiate_kyb(...)

📝 Description

This endpoint is used to initiate KYB for an entity. Send a request to this endpoint only after the entity has accepted the Mercoa ToS, all representatives have been added, and all required fields have been filled out.

🔌 Usage

from mercoa.client import Mercoa

client = Mercoa(
    token="YOUR_TOKEN",
)
client.entity.initiate_kyb(
    entity_id="ent_a0f6ea94-0761-4a5e-a416-3c453cb7eced",
)

⚙️ Parameters

entity_id: EntityId — Entity ID or Entity ForeignID

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.entity.get_token(...)

📝 Description

Generate a JWT token for an entity with the given options. This token can be used to authenticate the entity in the Mercoa API and iFrame.

We recommend using this endpoint. This will enable features such as approvals and comments.

🔌 Usage

from mercoa import TokenGenerationOptions
from mercoa.client import Mercoa

client = Mercoa(
    token="YOUR_TOKEN",
)
client.entity.get_token(
    entity_id="ent_a0f6ea94-0761-4a5e-a416-3c453cb7eced",
    request=TokenGenerationOptions(
        expires_in="1h",
    ),
)

⚙️ Parameters

entity_id: EntityId — Entity ID or Entity ForeignID

request: TokenGenerationOptions

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.entity.plaid_link_token(...)

📝 Description

Get a Plaid link token for an entity. This token can be used to add or update a bank account to the entity using Plaid Link.

🔌 Usage

from mercoa.client import Mercoa

client = Mercoa(
    token="YOUR_TOKEN",
)
client.entity.plaid_link_token(
    entity_id="string",
    payment_method_id="string",
)

⚙️ Parameters

entity_id: EntityId — Entity ID or Entity ForeignID

payment_method_id: typing.Optional[PaymentMethodId] — ID of Bank Account to update

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.entity.get_onboarding_link(...)

📝 Description

Generate an onboarding link for the entity.

🔌 Usage

from mercoa.client import Mercoa

client = Mercoa(
    token="YOUR_TOKEN",
)
client.entity.get_onboarding_link(
    entity_id="ent_a0f6ea94-0761-4a5e-a416-3c453cb7eced",
    type="PAYOR",
    expires_in="1h",
)

⚙️ Parameters

entity_id: EntityId — Entity ID or Entity ForeignID

type: EntityOnboardingLinkType — The type of onboarding link to generate. If not provided, the default is payee. The onboarding options are determined by your organization's onboarding configuration.

expires_in: typing.Optional[str] — Expressed in seconds or a string describing a time span. The default is 24h.

connected_entity_id: typing.Optional[EntityId] — The ID of the entity to connect to. If onboarding a payee, this should be the payor entity ID. If onboarding a payor, this should be the payee entity ID. If no connected entity ID is provided, the onboarding link will be for a standalone entity.

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.entity.send_onboarding_link(...)

📝 Description

Send an email with a onboarding link to the entity. The email will be sent to the email address associated with the entity.

🔌 Usage

from mercoa.client import Mercoa

client = Mercoa(
    token="YOUR_TOKEN",
)
client.entity.send_onboarding_link(
    entity_id="string",
    type="PAYEE",
    expires_in="string",
    connected_entity_id="string",
)

⚙️ Parameters

entity_id: EntityId — Entity ID or Entity ForeignID

type: EntityOnboardingLinkType — The type of onboarding link to generate. If not provided, the default is payee. The onboarding options are determined by your organization's onboarding configuration.

expires_in: typing.Optional[str] — Expressed in seconds or a string describing a time span. The default is 7 days.

connected_entity_id: typing.Optional[EntityId] — The ID of the entity to connect to. If onboarding a payee, this should be the payor entity ID. If onboarding a payor, this should be the payee entity ID. If no connected entity ID is provided, the onboarding link will be for a standalone entity.

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

Entity EmailLog

client.entity.email_log.find(...)

📝 Description

Get all incoming invoice emails for an entity.

🔌 Usage

from mercoa.client import Mercoa

client = Mercoa(
    token="YOUR_TOKEN",
)
client.entity.email_log.find(
    entity_id="ent_8545a84e-a45f-41bf-bdf1-33b42a55812c",
)

⚙️ Parameters

entity_id: EntityId — Entity ID or Entity ForeignID

start_date: typing.Optional[dt.datetime]

end_date: typing.Optional[dt.datetime]

limit: typing.Optional[int] — Number of logs to return. Limit can range between 1 and 100, and the default is 10.

starting_after: typing.Optional[EntityId] — The ID of the log to start after. If not provided, the first page of logs will be returned.

search: typing.Optional[str] — Search for logs by email address or subject

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.entity.email_log.get(...)

📝 Description

Get an email log by ID

🔌 Usage

from mercoa.client import Mercoa

client = Mercoa(
    token="YOUR_TOKEN",
)
client.entity.email_log.get(
    entity_id="ent_8545a84e-a45f-41bf-bdf1-33b42a55812c",
    log_id="log_8545a84e-a45f-41bf-bdf1-33b42a55812c",
)

⚙️ Parameters

entity_id: EntityId — Entity ID or Entity ForeignID

log_id: EmailLogId

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

Entity User

client.entity.user.get_all(...)

📝 Description

Get all entity users (DEPRECATED, use Search Entity Users)

🔌 Usage

from mercoa.client import Mercoa

client = Mercoa(
    token="YOUR_TOKEN",
)
client.entity.user.get_all(
    entity_id="ent_a0f6ea94-0761-4a5e-a416-3c453cb7eced",
)

⚙️ Parameters

entity_id: EntityId — Entity ID or Entity ForeignID

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.entity.user.find(...)

📝 Description

Search entity users

🔌 Usage

from mercoa.client import Mercoa

client = Mercoa(
    token="YOUR_TOKEN",
)
client.entity.user.find(
    entity_id="ent_a0f6ea94-0761-4a5e-a416-3c453cb7eced",
    name="John",
)

⚙️ Parameters

entity_id: EntityId — Entity ID or Entity ForeignID

foreign_id: typing.Optional[typing.Union[str, typing.Sequence[str]]] — ID used to identify user in your system

role: typing.Optional[typing.Union[str, typing.Sequence[str]]] — Filter users by role. If multiple roles are provided, users with any of the roles will be returned.

name: typing.Optional[str] — Filter users by name. Partial matches are supported.

email: typing.Optional[str] — Filter users by email. Partial matches are supported.

limit: typing.Optional[int] — Number of entities to return. Limit can range between 1 and 100, and the default is 10.

starting_after: typing.Optional[EntityUserId] — The ID of the user to start after. If not provided, the first page of entities will be returned.

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.entity.user.create(...)

🔌 Usage

from mercoa import EntityUserRequest
from mercoa.client import Mercoa

client = Mercoa(
    token="YOUR_TOKEN",
)
client.entity.user.create(
    entity_id="ent_a0f6ea94-0761-4a5e-a416-3c453cb7eced",
    request=EntityUserRequest(
        foreign_id="MY-DB-ID-12345",
        email="john.doe@acme.com",
        name="John Doe",
        roles=["admin", "approver"],
    ),
)

⚙️ Parameters

entity_id: EntityId — Entity ID or Entity ForeignID

request: EntityUserRequest

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.entity.user.get(...)

📝 Description

Get entity user

🔌 Usage

from mercoa.client import Mercoa

client = Mercoa(
    token="YOUR_TOKEN",
)
client.entity.user.get(
    entity_id="ent_a0f6ea94-0761-4a5e-a416-3c453cb7eced",
    user_id="user_ec3aafc8-ea86-408a-a6c1-545497badbbb",
)

⚙️ Parameters

entity_id: EntityId — Entity ID or Entity ForeignID

user_id: EntityUserId

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.entity.user.update(...)

📝 Description

Update entity user

🔌 Usage

from mercoa import EntityUserRequest
from mercoa.client import Mercoa

client = Mercoa(
    token="YOUR_TOKEN",
)
client.entity.user.update(
    entity_id="ent_a0f6ea94-0761-4a5e-a416-3c453cb7eced",
    user_id="user_ec3aafc8-ea86-408a-a6c1-545497badbbb",
    request=EntityUserRequest(
        foreign_id="MY-DB-ID-12345",
        email="john.doe@acme.com",
        name="John Doe",
        roles=["admin", "approver"],
    ),
)

⚙️ Parameters

entity_id: EntityId — Entity ID or Entity ForeignID

user_id: EntityUserId

request: EntityUserRequest

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.entity.user.delete(...)

📝 Description

Delete entity user. This will also remove the user from all approval policies. If an approval policy will break as a result of this operation, this request will fail.

🔌 Usage

from mercoa.client import Mercoa

client = Mercoa(
    token="YOUR_TOKEN",
)
client.entity.user.delete(
    entity_id="string",
    user_id="string",
)

⚙️ Parameters

entity_id: EntityId — Entity ID or Entity ForeignID

user_id: EntityUserId

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.entity.user.get_token(...)

📝 Description

Generate a JWT token for an entity user with the given options. This token can be used to authenticate the entity and entity user in the Mercoa API and iFrame.

🔌 Usage

from mercoa import TokenGenerationOptions
from mercoa.client import Mercoa

client = Mercoa(
    token="YOUR_TOKEN",
)
client.entity.user.get_token(
    entity_id="ent_a0f6ea94-0761-4a5e-a416-3c453cb7eced",
    user_id="user_a0f6ea94-0761-4a5e-a416-3c453cb7eced",
    request=TokenGenerationOptions(
        expires_in="1h",
    ),
)

⚙️ Parameters

entity_id: EntityId — Entity ID or Entity ForeignID

user_id: EntityUserId

request: TokenGenerationOptions

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

Invoice

client.invoice.find(...)

📝 Description

Search invoices for all entities in the organization

🔌 Usage

from mercoa.client import Mercoa

client = Mercoa(
    token="YOUR_TOKEN",
)
client.invoice.find(
    entity_id="ent_8545a84e-a45f-41bf-bdf1-33b42a55812c",
)

⚙️ Parameters

entity_id: typing.Optional[typing.Union[EntityId, typing.Sequence[EntityId]]] — Filter invoices by the ID of the entity that created the invoice.

start_date: typing.Optional[dt.datetime] — Start date filter. Defaults to CREATED_AT unless specified the dateType is specified

end_date: typing.Optional[dt.datetime] — End date filter. Defaults to CREATED_AT unless specified the dateType is specified

date_type: typing.Optional[InvoiceDateFilter] — Type of date to filter by if startDate and endDate filters are provided. Defaults to CREATED_AT.

order_by: typing.Optional[InvoiceOrderByField] — Field to order invoices by. Defaults to CREATED_AT.

order_direction: typing.Optional[OrderDirection] — Direction to order invoices by. Defaults to asc.

limit: typing.Optional[int] — Number of invoices to return. Limit can range between 1 and 100, and the default is 10.

starting_after: typing.Optional[InvoiceId] — The ID of the invoice to start after. If not provided, the first page of invoices will be returned.

search: typing.Optional[str] — Find invoices by vendor name, invoice number, or amount. Partial matches are supported.

metadata: typing.Optional[ typing.Union[InvoiceMetadataFilter, typing.Sequence[InvoiceMetadataFilter]] ] — Filter invoices by metadata. Each filter will be applied as an AND condition. Duplicate keys will be ignored.

line_item_metadata: typing.Optional[ typing.Union[InvoiceMetadataFilter, typing.Sequence[InvoiceMetadataFilter]] ] — Filter invoices by line item metadata. Each filter will be applied as an AND condition. Duplicate keys will be ignored.

line_item_gl_account_id: typing.Optional[typing.Union[str, typing.Sequence[str]]] — Filter invoices by line item GL account ID. Each filter will be applied as an OR condition. Duplicate keys will be ignored.

payer_id: typing.Optional[typing.Union[EntityId, typing.Sequence[EntityId]]] — Filter invoices by payer ID.

vendor_id: typing.Optional[typing.Union[EntityId, typing.Sequence[EntityId]]] — Filter invoices by vendor ID.

approver_id: typing.Optional[typing.Union[EntityUserId, typing.Sequence[EntityUserId]]] — Filter invoices by assigned approver user ID.

approver_action: typing.Optional[typing.Union[ApproverAction, typing.Sequence[ApproverAction]]] — Filter invoices by approver action. Needs to be used with approverId. For example, if you want to find all invoices that have been approved by a specific user, you would use approverId and approverAction=APPROVE.

invoice_id: typing.Optional[typing.Union[InvoiceId, typing.Sequence[InvoiceId]]] — Filter invoices by invoice ID.

status: typing.Optional[typing.Union[InvoiceStatus, typing.Sequence[InvoiceStatus]]] — Invoice status to filter on

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.invoice.create(...)

🔌 Usage

import datetime

from mercoa import InvoiceCreationRequest
from mercoa.client import Mercoa

client = Mercoa(
    token="YOUR_TOKEN",
)
client.invoice.create(
    request=InvoiceCreationRequest(
        status="SCHEDULED",
        payer_id="ent_8545a84e-a45f-41bf-bdf1-33b42a55812c",
        creator_entity_id="ent_8545a84e-a45f-41bf-bdf1-33b42a55812c",
        vendor_id="ent_21661ac1-a2a8-4465-a6c0-64474ba8181d",
        currency="USD",
        amount=100.0,
        invoice_date=datetime.datetime.fromisoformat(
            "2021-01-01 00:00:00+00:00",
        ),
        due_date=datetime.datetime.fromisoformat(
            "2021-01-31 00:00:00+00:00",
        ),
        payment_source_id="pm_4794d597-70dc-4fec-b6ec-c5988e759769",
        payment_destination_id="pm_5fde2f4a-facc-48ef-8f0d-6b7d087c7b18",
        deduction_date=datetime.datetime.fromisoformat(
            "2021-01-29 00:00:00+00:00",
        ),
    ),
)

⚙️ Parameters

request: InvoiceCreationRequest

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.invoice.get(...)

🔌 Usage

from mercoa.client import Mercoa

client = Mercoa(
    token="YOUR_TOKEN",
)
client.invoice.get(
    invoice_id="inv_8545a84e-a45f-41bf-bdf1-33b42a55812c",
)

⚙️ Parameters

invoice_id: InvoiceId — Invoice ID or Invoice ForeignID

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.invoice.update(...)

🔌 Usage

import datetime

from mercoa import InvoiceUpdateRequest
from mercoa.client import Mercoa

client = Mercoa(
    token="YOUR_TOKEN",
)
client.invoice.update(
    invoice_id="inv_8545a84e-a45f-41bf-bdf1-33b42a55812c",
    request=InvoiceUpdateRequest(
        status="SCHEDULED",
        payment_destination_id="pm_5fde2f4a-facc-48ef-8f0d-6b7d087c7b18",
        deduction_date=datetime.datetime.fromisoformat(
            "2021-01-29 00:00:00+00:00",
        ),
    ),
)

⚙️ Parameters

invoice_id: InvoiceId — Invoice ID or Invoice ForeignID

request: InvoiceUpdateRequest

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.invoice.delete(...)

📝 Description

Only invoices in the DRAFT and NEW status can be deleted.

🔌 Usage

from mercoa.client import Mercoa

client = Mercoa(
    token="YOUR_TOKEN",
)
client.invoice.delete(
    invoice_id="inv_8545a84e-a45f-41bf-bdf1-33b42a55812c",
)

⚙️ Parameters

invoice_id: InvoiceId — Invoice ID or Invoice ForeignID

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

Invoice LineItem

client.invoice.line_item.update(...)

📝 Description

Update invoice line item

🔌 Usage

import datetime

from mercoa import InvoiceLineItemIndividualUpdateRequest
from mercoa.client import Mercoa

client = Mercoa(
    token="YOUR_TOKEN",
)
client.invoice.line_item.update(
    invoice_id="in_d8f68285-1c6d-4d5a-a9e3-252c3180fac4",
    line_item_id="inli_8aa84cb8-2ae7-4579-8fa3-87586e7c14a7",
    request=InvoiceLineItemIndividualUpdateRequest(
        name="Product A",
        description="Product A",
        service_start_date=datetime.datetime.fromisoformat(
            "2021-01-01 00:00:00+00:00",
        ),
        service_end_date=datetime.datetime.fromisoformat(
            "2021-01-31 00:00:00+00:00",
        ),
        metadata={"key1": "value1", "key2": "value2"},
        gl_account_id="600394",
    ),
)

⚙️ Parameters

invoice_id: InvoiceId — Invoice ID

line_item_id: InvoiceLineItemId — Invoice Line Item ID

request: InvoiceLineItemIndividualUpdateRequest

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

Organization

client.organization.get(...)

📝 Description

Get current organization information

🔌 Usage

from mercoa.client import Mercoa

client = Mercoa(
    token="YOUR_TOKEN",
)
client.organization.get(
    payment_methods=True,
    email_provider=True,
    external_accounting_system_provider=True,
    color_scheme=True,
    payee_onboarding_options=True,
    payor_onboarding_options=True,
    metadata_schema=True,
)

⚙️ Parameters

payment_methods: typing.Optional[bool] — include supported payment methods in response

email_provider: typing.Optional[bool] — include email provider info in response

external_accounting_system_provider: typing.Optional[bool] — include external accounting system provider info in response

color_scheme: typing.Optional[bool] — include color scheme info in response

payee_onboarding_options: typing.Optional[bool] — include payee onboarding options in response

payor_onboarding_options: typing.Optional[bool] — include payor onboarding options in response

metadata_schema: typing.Optional[bool] — include metadata schema in response

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.organization.update(...)

📝 Description

Update current organization

🔌 Usage

from mercoa import (
    ColorSchemeRequest,
    EmailProviderRequest,
    ExternalAccountingSystemProviderRequest_None,
    MetadataSchema,
    OnboardingOptionsRequest,
    OrganizationRequest,
    PaymentMethodsRequest,
)
from mercoa.client import Mercoa

client = Mercoa(
    token="YOUR_TOKEN",
)
client.organization.update(
    request=OrganizationRequest(
        name="string",
        logo="string",
        website_url="string",
        support_email="string",
        payment_methods=PaymentMethodsRequest(),
        email_provider=EmailProviderRequest(),
        external_accounting_system_provider=ExternalAccountingSystemProviderRequest_None(),
        color_scheme=ColorSchemeRequest(),
        payee_onboarding_options=OnboardingOptionsRequest(),
        payor_onboarding_options=OnboardingOptionsRequest(),
        metadata_schema=[MetadataSchema()],
    ),
)

⚙️ Parameters

request: OrganizationRequest

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.organization.email_log(...)

📝 Description

Get log of all emails sent to this organization. Content format subject to change.

🔌 Usage

import datetime

from mercoa.client import Mercoa

client = Mercoa(
    token="YOUR_TOKEN",
)
client.organization.email_log(
    start_date=datetime.datetime.fromisoformat(
        "2024-01-15 09:30:00+00:00",
    ),
    end_date=datetime.datetime.fromisoformat(
        "2024-01-15 09:30:00+00:00",
    ),
    limit=1,
    starting_after="string",
)

⚙️ Parameters

start_date: typing.Optional[dt.datetime]

end_date: typing.Optional[dt.datetime]

limit: typing.Optional[int] — Number of logs to return. Limit can range between 1 and 100, and the default is 10.

starting_after: typing.Optional[str] — The ID of the log to start after. If not provided, the first page of logs will be returned.

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

BankLookup

client.bank_lookup.find(...)

📝 Description

Find bank account details

🔌 Usage

from mercoa.client import Mercoa

client = Mercoa(
    token="YOUR_TOKEN",
)
client.bank_lookup.find(
    routing_number="026009593",
)

⚙️ Parameters

routing_number: str — Routing number to validate

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

Calculate

client.calculate.fee(...)

📝 Description

Calculate the estimated fees associated with an payment given the amount, payment source, and disbursement method. Can be used to calculate fees for a payment before creating an invoice.

🔌 Usage

from mercoa import CalculateFeesRequest
from mercoa.client import Mercoa

client = Mercoa(
    token="YOUR_TOKEN",
)
client.calculate.fee(
    request=CalculateFeesRequest(
        amount=100.0,
        payment_source_id="pm_4794d597-70dc-4fec-b6ec-c5988e759769",
        payment_destination_id="pm_4794d597-70dc-4fec-b6ec-c5988e759769",
    ),
)

⚙️ Parameters

request: CalculateFeesRequest

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.calculate.payment_timing(...)

📝 Description

Calculate the estimated payment timing given the deduction date, payment source, and disbursement method. Can be used to calculate timing for a payment.

🔌 Usage

import datetime

from mercoa import CalculatePaymentTimingRequest
from mercoa.client import Mercoa

client = Mercoa(
    token="YOUR_TOKEN",
)
client.calculate.payment_timing(
    request=CalculatePaymentTimingRequest(
        estimated_deduction_date=datetime.datetime.fromisoformat(
            "2024-01-02 00:00:00+00:00",
        ),
        payment_source_id="pm_4794d597-70dc-4fec-b6ec-c5988e759769",
        payment_destination_id="pm_4794d597-70dc-4fec-b6ec-c5988e759769",
    ),
)

⚙️ Parameters

request: CalculatePaymentTimingRequest

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

CustomPaymentMethodSchema

client.custom_payment_method_schema.get_all()

📝 Description

Get all custom payment method schemas

🔌 Usage

from mercoa.client import Mercoa

client = Mercoa(
    token="YOUR_TOKEN",
)
client.custom_payment_method_schema.get_all()

⚙️ Parameters

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.custom_payment_method_schema.create(...)

📝 Description

Create custom payment method schema

🔌 Usage

from mercoa import (
    CustomPaymentMethodSchemaField,
    CustomPaymentMethodSchemaRequest,
)
from mercoa.client import Mercoa

client = Mercoa(
    token="YOUR_TOKEN",
)
client.custom_payment_method_schema.create(
    request=CustomPaymentMethodSchemaRequest(
        name="Check",
        is_source=False,
        is_destination=True,
        supported_currencies=["USD"],
        fields=[
            CustomPaymentMethodSchemaField(
                name="payToTheOrderOf",
                display_name="Pay To The Order Of",
                type="text",
                optional=False,
            ),
            CustomPaymentMethodSchemaField(
                name="accountNumber",
                display_name="Account Number",
                type="usBankAccountNumber",
                optional=False,
                use_as_account_number=True,
            ),
            CustomPaymentMethodSchemaField(
                name="routingNumber",
                display_name="Routing Number",
                type="usBankRoutingNumber",
                optional=False,
            ),
            CustomPaymentMethodSchemaField(
                name="address",
                display_name="Address",
                type="address",
                optional=False,
            ),
        ],
        estimated_processing_time=7,
        max_amount=50000.0,
        min_amount=1.0,
    ),
)

⚙️ Parameters

request: CustomPaymentMethodSchemaRequest

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.custom_payment_method_schema.update(...)

📝 Description

Update custom payment method schema

🔌 Usage

from mercoa import (
    CustomPaymentMethodSchemaField,
    CustomPaymentMethodSchemaRequest,
)
from mercoa.client import Mercoa

client = Mercoa(
    token="YOUR_TOKEN",
)
client.custom_payment_method_schema.update(
    schema_id="cpms_14f78dcd-4614-426e-a37a-7af262431d41",
    request=CustomPaymentMethodSchemaRequest(
        name="Wire",
        is_source=False,
        is_destination=True,
        supported_currencies=["USD", "EUR"],
        fields=[
            CustomPaymentMethodSchemaField(
                name="bankName",
                display_name="Bank Name",
                type="text",
                optional=False,
            ),
            CustomPaymentMethodSchemaField(
                name="recipientName",
                display_name="Recipient Name",
                type="text",
                optional=False,
            ),
            CustomPaymentMethodSchemaField(
                name="accountNumber",
                display_name="Account Number",
                type="usBankAccountNumber",
                optional=False,
                use_as_account_number=True,
            ),
            CustomPaymentMethodSchemaField(
                name="routingNumber",
                display_name="Routing Number",
                type="usBankRoutingNumber",
                optional=False,
            ),
        ],
        estimated_processing_time=0,
        max_amount=100000.0,
        min_amount=1.0,
    ),
)

⚙️ Parameters

schema_id: CustomPaymentMethodSchemaId

request: CustomPaymentMethodSchemaRequest

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.custom_payment_method_schema.get(...)

📝 Description

Get custom payment method schema

🔌 Usage

from mercoa.client import Mercoa

client = Mercoa(
    token="YOUR_TOKEN",
)
client.custom_payment_method_schema.get(
    schema_id="cpms_14f78dcd-4614-426e-a37a-7af262431d41",
)

⚙️ Parameters

schema_id: CustomPaymentMethodSchemaId

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.custom_payment_method_schema.delete(...)

📝 Description

Delete custom payment method schema. Schema that have been used in an invoice cannot be deleted.

🔌 Usage

from mercoa.client import Mercoa

client = Mercoa(
    token="YOUR_TOKEN",
)
client.custom_payment_method_schema.delete(
    schema_id="cpms_14f78dcd-4614-426e-a37a-7af262431d41",
)

⚙️ Parameters

schema_id: CustomPaymentMethodSchemaId

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

EntityGroup Invoice

client.entity_group.invoice.find(...)

📝 Description

Get invoices for an entity group with the given filters.

🔌 Usage

from mercoa.client import Mercoa

client = Mercoa(
    token="YOUR_TOKEN",
)
client.entity_group.invoice.find(
    entity_group_id="entg_8545a84e-a45f-41bf-bdf1-33b42a55812c",
    exclude_receivables=True,
    order_by="CREATED_AT",
    order_direction="ASC",
    limit=10,
)

⚙️ Parameters

entity_group_id: EntityGroupId

exclude_payables: typing.Optional[bool] — Return only invoices that are receivable by the entity.

exclude_receivables: typing.Optional[bool] — Return only invoices that are payable by the entity.

start_date: typing.Optional[dt.datetime] — Start date for invoice created on date filter.

end_date: typing.Optional[dt.datetime] — End date for invoice created date filter.

date_type: typing.Optional[InvoiceDateFilter] — Type of date to filter by if startDate and endDate filters are provided. Defaults to CREATED_AT.

order_by: typing.Optional[InvoiceOrderByField] — Field to order invoices by. Defaults to CREATED_AT.

order_direction: typing.Optional[OrderDirection] — Direction to order invoices by. Defaults to asc.

limit: typing.Optional[int] — Number of invoices to return. Limit can range between 1 and 100, and the default is 10.

starting_after: typing.Optional[InvoiceId] — The ID of the invoice to start after. If not provided, the first page of invoices will be returned.

metadata: typing.Optional[ typing.Union[InvoiceMetadataFilter, typing.Sequence[InvoiceMetadataFilter]] ] — Filter invoices by metadata. Each filter will be applied as an AND condition. Duplicate keys will be ignored.

search: typing.Optional[str] — Find invoices by vendor name, invoice number, or amount. Partial matches are supported.

payer_id: typing.Optional[typing.Union[EntityId, typing.Sequence[EntityId]]] — Filter invoices by payer ID.

vendor_id: typing.Optional[typing.Union[EntityId, typing.Sequence[EntityId]]] — Filter invoices by vendor ID.

approver_id: typing.Optional[typing.Union[EntityUserId, typing.Sequence[EntityUserId]]] — Filter invoices by assigned approver user ID.

approver_action: typing.Optional[typing.Union[ApproverAction, typing.Sequence[ApproverAction]]] — Filter invoices by approver action. Needs to be used with approverId. For example, if you want to find all invoices that have been approved by a specific user, you would use approverId and approverAction=APPROVE.

invoice_id: typing.Optional[typing.Union[InvoiceId, typing.Sequence[InvoiceId]]] — Filter invoices by invoice ID.

status: typing.Optional[typing.Union[InvoiceStatus, typing.Sequence[InvoiceStatus]]] — Invoice status to filter on.

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.entity_group.invoice.metrics(...)

📝 Description

Get invoice metrics for an entity group with the given filters. Invoices will be grouped by currency. If none of excludePayables, excludeReceivables, payerId, vendorId, or invoiceId status filters are provided, excludeReceivables will be set to true.

🔌 Usage

import datetime

from mercoa.client import Mercoa

client = Mercoa(
    token="YOUR_TOKEN",
)
client.entity_group.invoice.metrics(
    entity_group_id="entg_8545a84e-a45f-41bf-bdf1-33b42a55812c",
    return_by_date="CREATION_DATE",
    exclude_receivables=True,
    created_date_start=datetime.datetime.fromisoformat(
        "2021-01-01 00:00:00+00:00",
    ),
    created_date_end=datetime.datetime.fromisoformat(
        "2021-01-31 23:59:59.999000+00:00",
    ),
    currency="USD",
    status="NEW",
)

⚙️ Parameters

entity_group_id: EntityGroupId

search: typing.Optional[str] — Find invoices by vendor name, invoice number, or amount. Partial matches are supported.

exclude_payables: typing.Optional[bool] — Only return invoices that are not payable by the entity. This will return only invoices that are receivable by the entity.

exclude_receivables: typing.Optional[bool] — Only return invoices that are not receivable by the entity. This will return only invoices that are payable by the entity.

return_by_date: typing.Optional[InvoiceMetricsPerDateGroupBy] — Return invoice metrics grouped by date.

payer_id: typing.Optional[typing.Union[EntityId, typing.Sequence[EntityId]]] — Filter invoices by payer ID.

vendor_id: typing.Optional[typing.Union[EntityId, typing.Sequence[EntityId]]] — Filter invoices by vendor ID.

approver_id: typing.Optional[typing.Union[EntityUserId, typing.Sequence[EntityUserId]]] — Filter invoices by assigned approver user ID.

invoice_id: typing.Optional[typing.Union[InvoiceId, typing.Sequence[InvoiceId]]] — Filter invoices by invoice ID.

status: typing.Optional[typing.Union[InvoiceStatus, typing.Sequence[InvoiceStatus]]] — Invoice status to filter on

start_date: typing.Optional[dt.datetime] — Start date filter. Defaults to CREATED_AT unless specified the dateType is specified

end_date: typing.Optional[dt.datetime] — End date filter. Defaults to CREATED_AT unless specified the dateType is specified

date_type: typing.Optional[InvoiceDateFilter] — Type of date to filter by if startDate and endDate filters are provided. Defaults to CREATED_AT.

due_date_start: typing.Optional[dt.datetime] — DEPRECATED. Use startDate, endDate, and dateType instead. Start date for invoice dueDate filter.

due_date_end: typing.Optional[dt.datetime] — DEPRECATED. Use startDate, endDate, and dateType instead. End date for invoice dueDate filter.

created_date_start: typing.Optional[dt.datetime] — DEPRECATED. Use startDate, endDate, and dateType instead. Start date for invoice created on date filter.

created_date_end: typing.Optional[dt.datetime] — DEPRECATED. Use startDate, endDate, and dateType instead. End date for invoice created date filter.

currency: typing.Optional[typing.Union[CurrencyCode, typing.Sequence[CurrencyCode]]] — Currency to filter on

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

Entity ApprovalPolicy

client.entity.approval_policy.get_all(...)

📝 Description

Retrieve all invoice approval policies associated with an entity

🔌 Usage

from mercoa.client import Mercoa

client = Mercoa(
    token="YOUR_TOKEN",
)
client.entity.approval_policy.get_all(
    entity_id="ent_8545a84e-a45f-41bf-bdf1-33b42a55812c",
)

⚙️ Parameters

entity_id: EntityId — Entity ID or Entity ForeignID

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.entity.approval_policy.create(...)

📝 Description

Create an invoice approval policy associated with an entity

🔌 Usage

from mercoa import ApprovalPolicyRequest, IdentifierList_UserList, Rule_Approver
from mercoa.client import Mercoa

client = Mercoa(
    token="YOUR_TOKEN",
)
client.entity.approval_policy.create(
    entity_id="ent_8545a84e-a45f-41bf-bdf1-33b42a55812c",
    request=ApprovalPolicyRequest(
        trigger=[],
        rule=Rule_Approver(
            num_approvers=2,
            identifier_list=IdentifierList_UserList(
                value=[
                    "usr_8545a84e-a45f-41bf-bdf1-33b42a55812c",
                    "usr_21661ac1-a2a8-4465-a6c0-64474ba8181d",
                ]
            ),
        ),
        upstream_policy_id="root",
    ),
)

⚙️ Parameters

entity_id: EntityId — Entity ID or Entity ForeignID

request: ApprovalPolicyRequest

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.entity.approval_policy.get(...)

📝 Description

Retrieve an invoice approval policy associated with an entity

🔌 Usage

from mercoa.client import Mercoa

client = Mercoa(
    token="YOUR_TOKEN",
)
client.entity.approval_policy.get(
    entity_id="ent_8545a84e-a45f-41bf-bdf1-33b42a55812c",
    policy_id="apvl_5ce50275-1789-42ea-bc60-bb7e6d03635c",
)

⚙️ Parameters

entity_id: EntityId — Entity ID or Entity ForeignID

policy_id: ApprovalPolicyId

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.entity.approval_policy.update(...)

📝 Description

Update an invoice approval policy associated with an entity

🔌 Usage

from mercoa import (
    ApprovalPolicyUpdateRequest,
    IdentifierList_UserList,
    Rule_Approver,
)
from mercoa.client import Mercoa

client = Mercoa(
    token="YOUR_TOKEN",
)
client.entity.approval_policy.update(
    entity_id="ent_8545a84e-a45f-41bf-bdf1-33b42a55812c",
    policy_id="apvl_5ce50275-1789-42ea-bc60-bb7e6d03635c",
    request=ApprovalPolicyUpdateRequest(
        trigger=[],
        rule=Rule_Approver(
            num_approvers=2,
            identifier_list=IdentifierList_UserList(
                value=[
                    "usr_8545a84e-a45f-41bf-bdf1-33b42a55812c",
                    "usr_21661ac1-a2a8-4465-a6c0-64474ba8181d",
                ]
            ),
        ),
        upstream_policy_id="root",
    ),
)

⚙️ Parameters

entity_id: EntityId — Entity ID or Entity ForeignID

policy_id: ApprovalPolicyId

request: ApprovalPolicyUpdateRequest

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.entity.approval_policy.delete(...)

📝 Description

Delete an invoice approval policy associated with Entity. BEWARE: Any approval policy deletion will result in all associated downstream policies also being deleted.

🔌 Usage

from mercoa.client import Mercoa

client = Mercoa(
    token="YOUR_TOKEN",
)
client.entity.approval_policy.delete(
    entity_id="ent_8545a84e-a45f-41bf-bdf1-33b42a55812c",
    policy_id="apvl_5ce50275-1789-42ea-bc60-bb7e6d03635c",
)

⚙️ Parameters

entity_id: EntityId — Entity ID or Entity ForeignID

policy_id: ApprovalPolicyId

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

Entity Counterparty

client.entity.counterparty.find_payees(...)

📝 Description

Find payee counterparties. This endpoint lets you find vendors linked to the entity.

🔌 Usage

from mercoa.client import Mercoa

client = Mercoa(
    token="YOUR_TOKEN",
)
client.entity.counterparty.find_payees(
    entity_id="ent_8545a84e-a45f-41bf-bdf1-33b42a55812c",
    name="Big Box",
    payment_methods=True,
    invoice_metrics=True,
)

⚙️ Parameters

entity_id: EntityId — Entity ID or Entity ForeignID

name: typing.Optional[str] — Filter by counterparty name

network_type: typing.Optional[ typing.Union[ CounterpartyNetworkType, typing.Sequence[CounterpartyNetworkType] ] ] — Filter by network type. By default, only ENTITY counterparties are returned.

payment_methods: typing.Optional[bool] — If true, will include counterparty payment methods as part of the response

invoice_metrics: typing.Optional[bool] — If true, will include counterparty invoice metrics as part of the response

counterparty_id: typing.Optional[typing.Union[EntityId, typing.Sequence[EntityId]]] — Filter by counterparty ids

limit: typing.Optional[int] — Number of counterparties to return. Limit can range between 1 and 100, and the default is 10.

starting_after: typing.Optional[EntityId] — The ID of the counterparties to start after. If not provided, the first page of counterparties will be returned.

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.entity.counterparty.find_payors(...)

📝 Description

Find payor counterparties. This endpoint lets you find customers linked to the entity.

🔌 Usage

from mercoa.client import Mercoa

client = Mercoa(
    token="YOUR_TOKEN",
)
client.entity.counterparty.find_payors(
    entity_id="ent_8545a84e-a45f-41bf-bdf1-33b42a55812c",
    name="Big Box",
    payment_methods=True,
    invoice_metrics=True,
)

⚙️ Parameters

entity_id: EntityId — Entity ID or Entity ForeignID

name: typing.Optional[str] — Filter by counterparty name

network_type: typing.Optional[ typing.Union[ CounterpartyNetworkType, typing.Sequence[CounterpartyNetworkType] ] ] — Filter by network type. By default, only ENTITY counterparties are returned.

payment_methods: typing.Optional[bool] — If true, will include counterparty payment methods as part of the response

invoice_metrics: typing.Optional[bool] — If true, will include counterparty invoice metrics as part of the response

counterparty_id: typing.Optional[typing.Union[EntityId, typing.Sequence[EntityId]]] — Filter by counterparty ids

limit: typing.Optional[int] — Number of counterparties to return. Limit can range between 1 and 100, and the default is 10.

starting_after: typing.Optional[EntityId] — The ID of the counterparties to start after. If not provided, the first page of counterparties will be returned.

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.entity.counterparty.add_payees(...)

📝 Description

Create association between Entity and a given list of Payees. If a Payee has previously been archived, unarchive the Payee.

🔌 Usage

from mercoa import (
    CounterpartyCustomizationAccount,
    CounterpartyCustomizationRequest,
    EntityAddPayeesRequest,
)
from mercoa.client import Mercoa

client = Mercoa(
    token="YOUR_TOKEN",
)
client.entity.counterparty.add_payees(
    entity_id="ent_8545a84e-a45f-41bf-bdf1-33b42a55812c",
    request=EntityAddPayeesRequest(
        payees=["ent_21661ac1-a2a8-4465-a6c0-64474ba8181d"],
        customizations=[
            CounterpartyCustomizationRequest(
                counterparty_id="ent_21661ac1-a2a8-4465-a6c0-64474ba8181d",
                accounts=[
                    CounterpartyCustomizationAccount(
                        account_id="85866843",
                        postal_code="94105",
                        name_on_account="John Doe",
                    )
                ],
            )
        ],
    ),
)

⚙️ Parameters

entity_id: EntityId — Entity ID or Entity ForeignID

request: EntityAddPayeesRequest

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.entity.counterparty.hide_payees(...)

📝 Description

Marks Payees as unsearchable by Entity via Counterparty search. Invoices associated with these Payees will still be searchable via Invoice search.

🔌 Usage

from mercoa import EntityHidePayeesRequest
from mercoa.client import Mercoa

client = Mercoa(
    token="YOUR_TOKEN",
)
client.entity.counterparty.hide_payees(
    entity_id="ent_8545a84e-a45f-41bf-bdf1-33b42a55812c",
    request=EntityHidePayeesRequest(
        payees=["ent_21661ac1-a2a8-4465-a6c0-64474ba8181d"],
    ),
)

⚙️ Parameters

entity_id: EntityId — Entity ID or Entity ForeignID

request: EntityHidePayeesRequest

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.entity.counterparty.add_payors(...)

📝 Description

Create association between Entity and a given list of Payors. If a Payor has previously been archived, unarchive the Payor.

🔌 Usage

from mercoa import (
    CounterpartyCustomizationAccount,
    CounterpartyCustomizationRequest,
    EntityAddPayorsRequest,
)
from mercoa.client import Mercoa

client = Mercoa(
    token="YOUR_TOKEN",
)
client.entity.counterparty.add_payors(
    entity_id="ent_8545a84e-a45f-41bf-bdf1-33b42a55812c",
    request=EntityAddPayorsRequest(
        payors=["ent_21661ac1-a2a8-4465-a6c0-64474ba8181d"],
        customizations=[
            CounterpartyCustomizationRequest(
                counterparty_id="ent_21661ac1-a2a8-4465-a6c0-64474ba8181d",
                accounts=[
                    CounterpartyCustomizationAccount(
                        account_id="85866843",
                        postal_code="94105",
                        name_on_account="John Doe",
                    )
                ],
            )
        ],
    ),
)

⚙️ Parameters

entity_id: EntityId — Entity ID or Entity ForeignID

request: EntityAddPayorsRequest

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.entity.counterparty.hide_payors(...)

📝 Description

Marks Payors as unsearchable by Entity via Counterparty search. Invoices associated with these Payors will still be searchable via Invoice search.

🔌 Usage

from mercoa import EntityHidePayorsRequest
from mercoa.client import Mercoa

client = Mercoa(
    token="YOUR_TOKEN",
)
client.entity.counterparty.hide_payors(
    entity_id="ent_8545a84e-a45f-41bf-bdf1-33b42a55812c",
    request=EntityHidePayorsRequest(
        payors=["ent_21661ac1-a2a8-4465-a6c0-64474ba8181d"],
    ),
)

⚙️ Parameters

entity_id: EntityId — Entity ID or Entity ForeignID

request: EntityHidePayorsRequest

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

Entity Customization

client.entity.customization.get(...)

📝 Description

Get entity customization.

🔌 Usage

from mercoa.client import Mercoa

client = Mercoa(
    token="YOUR_TOKEN",
)
client.entity.customization.get(
    entity_id="ent_a0f6ea94-0761-4a5e-a416-3c453cb7eced",
)

⚙️ Parameters

entity_id: EntityId — Entity ID or Entity ForeignID

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.entity.customization.update(...)

📝 Description

Update entity customization. This lets you turn off metadata and payment methods for an entity.

🔌 Usage

from mercoa import (
    EntityCustomizationRequest,
    MetadataCustomizationRequest,
    PaymentMethodCustomizationRequest,
)
from mercoa.client import Mercoa

client = Mercoa(
    token="YOUR_TOKEN",
)
client.entity.customization.update(
    entity_id="ent_a0f6ea94-0761-4a5e-a416-3c453cb7eced",
    request=EntityCustomizationRequest(
        metadata=[
            MetadataCustomizationRequest(
                key="my_custom_field",
                disabled=True,
            ),
            MetadataCustomizationRequest(
                key="my_other_field",
                disabled=False,
            ),
        ],
        payment_source=[
            PaymentMethodCustomizationRequest(
                type="bankAccount",
                disabled=True,
            ),
            PaymentMethodCustomizationRequest(
                type="custom",
                schema_id="cpms_7df2974a-4069-454c-912f-7e58ebe030fb",
                disabled=True,
            ),
        ],
        backup_disbursement=[
            PaymentMethodCustomizationRequest(
                type="check",
                disabled=True,
            )
        ],
        payment_destination=[
            PaymentMethodCustomizationRequest(
                type="bankAccount",
                disabled=True,
            ),
            PaymentMethodCustomizationRequest(
                type="check",
                disabled=True,
            ),
        ],
    ),
)

⚙️ Parameters

entity_id: EntityId — Entity ID or Entity ForeignID

request: EntityCustomizationRequest

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

Entity Document

client.entity.document.get_all(...)

📝 Description

Get documents (1099/W9) associated with this entity

🔌 Usage

from mercoa.client import Mercoa

client = Mercoa(
    token="YOUR_TOKEN",
)
client.entity.document.get_all(
    entity_id="ent_26e7b5d3-a739-4b23-9ad9-6aaa085f47a9",
)

⚙️ Parameters

entity_id: EntityId

type: typing.Optional[typing.Union[DocumentType, typing.Sequence[DocumentType]]] — Filter by document type

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.entity.document.upload(...)

📝 Description

Upload documents associated with this entity

🔌 Usage

from mercoa.client import Mercoa

client = Mercoa(
    token="YOUR_TOKEN",
)
client.entity.document.upload(
    entity_id="ent_26e7b5d3-a739-4b23-9ad9-6aaa085f47a9",
    document="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAIAQMAAAD+wSzIAAAABlBMVEX///+/v7+jQ3Y5AAAADklEQVQI12P4AIX8EAgALgAD/aNpbtEAAAAASUVORK5CYII",
    type="TEN_NINETY_NINE",
)

⚙️ Parameters

entity_id: EntityId

document: str — Base64 encoded image or PDF of document. PNG, JPG, WEBP, and PDF are supported. 10MB max.

type: DocumentType

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.entity.document.delete(...)

📝 Description

Delete a document associated with this entity

🔌 Usage

from mercoa.client import Mercoa

client = Mercoa(
    token="YOUR_TOKEN",
)
client.entity.document.delete(
    entity_id="ent_26e7b5d3-a739-4b23-9ad9-6aaa085f47a9",
    document_id="doc_37e6af0a-e637-48fd-b825-d6947b38c4e2",
)

⚙️ Parameters

entity_id: EntityId

document_id: str

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

Entity ExternalAccountingSystem

client.entity.external_accounting_system.get(...)

📝 Description

Get the external accounting system connected to an entity

🔌 Usage

from mercoa.client import Mercoa

client = Mercoa(
    token="YOUR_TOKEN",
)
client.entity.external_accounting_system.get(
    entity_id="ent_8545a84e-a45f-41bf-bdf1-33b42a55812c",
)

⚙️ Parameters

entity_id: EntityId — Entity ID or Entity ForeignID

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.entity.external_accounting_system.create(...)

📝 Description

Create/Link an entity to an external accounting system like Codat or Rutter. If the entity is already linked to an external accounting system, this will return the existing connection.

🔌 Usage

from mercoa.client import Mercoa
from mercoa.entity import ExternalAccountingSystemCompanyCreationRequest_Rutter

client = Mercoa(
    token="YOUR_TOKEN",
)
client.entity.external_accounting_system.create(
    entity_id="ent_8545a84e-a45f-41bf-bdf1-33b42a55812c",
    request=ExternalAccountingSystemCompanyCreationRequest_Rutter(
        access_token="123",
    ),
)

⚙️ Parameters

entity_id: EntityId — Entity ID or Entity ForeignID

request: ExternalAccountingSystemCompanyCreationRequest

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.entity.external_accounting_system.connect(...)

📝 Description

Get a link to connect an entity to an external accounting system like Quickbooks or Xero

🔌 Usage

from mercoa.client import Mercoa

client = Mercoa(
    token="YOUR_TOKEN",
)
client.entity.external_accounting_system.connect(
    entity_id="ent_8545a84e-a45f-41bf-bdf1-33b42a55812c",
)

⚙️ Parameters

entity_id: EntityId — Entity ID or Entity ForeignID

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.entity.external_accounting_system.sync(...)

📝 Description

Sync an entity with an external accounting system. Will sync customers/vendors and invoices.

🔌 Usage

from mercoa.client import Mercoa

client = Mercoa(
    token="YOUR_TOKEN",
)
client.entity.external_accounting_system.sync(
    entity_id="ent_8545a84e-a45f-41bf-bdf1-33b42a55812c",
    vendors="pull",
    bills="push",
    gl_accounts="pull",
)

⚙️ Parameters

entity_id: EntityId — Entity ID or Entity ForeignID

vendors: typing.Optional[SyncType] — Sync vendors from external accounting system. Default is to pull vendors from external system.

bills: typing.Optional[SyncType] — Sync bills from external accounting system. Default is to not sync bills. Invoices that already exist in both systems will not be updated, only new invoices not present in the other system will be created.

gl_accounts: typing.Optional[SyncType] — Sync GL accounts from external accounting system. Default is to pull GL accounts from external system. Pushing GL accounts is not supported.

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

Entity Invoice

client.entity.invoice.find(...)

📝 Description

Get invoices for an entity with the given filters.

🔌 Usage

from mercoa.client import Mercoa

client = Mercoa(
    token="YOUR_TOKEN",
)
client.entity.invoice.find(
    entity_id="ent_8545a84e-a45f-41bf-bdf1-33b42a55812c",
    exclude_receivables=True,
    order_by="CREATED_AT",
    order_direction="ASC",
    limit=10,
)

⚙️ Parameters

entity_id: EntityId — Entity ID or Entity ForeignID

exclude_payables: typing.Optional[bool] — Return only invoices that are receivable by the entity.

exclude_receivables: typing.Optional[bool] — Return only invoices that are payable by the entity.

start_date: typing.Optional[dt.datetime] — Start date filter. Defaults to CREATED_AT unless specified the dateType is specified

end_date: typing.Optional[dt.datetime] — End date filter. Defaults to CREATED_AT unless specified the dateType is specified

date_type: typing.Optional[InvoiceDateFilter] — Type of date to filter by if startDate and endDate filters are provided. Defaults to CREATED_AT.

order_by: typing.Optional[InvoiceOrderByField] — Field to order invoices by. Defaults to CREATED_AT.

order_direction: typing.Optional[OrderDirection] — Direction to order invoices by. Defaults to asc.

limit: typing.Optional[int] — Number of invoices to return. Limit can range between 1 and 100, and the default is 10.

starting_after: typing.Optional[InvoiceId] — The ID of the invoice to start after. If not provided, the first page of invoices will be returned.

metadata: typing.Optional[ typing.Union[InvoiceMetadataFilter, typing.Sequence[InvoiceMetadataFilter]] ] — Filter invoices by metadata. Each filter will be applied as an AND condition. Duplicate keys will be ignored.

line_item_metadata: typing.Optional[ typing.Union[InvoiceMetadataFilter, typing.Sequence[InvoiceMetadataFilter]] ] — Filter invoices by line item metadata. Each filter will be applied as an AND condition. Duplicate keys will be ignored.

line_item_gl_account_id: typing.Optional[typing.Union[str, typing.Sequence[str]]] — Filter invoices by line item GL account ID. Each filter will be applied as an OR condition. Duplicate keys will be ignored.

search: typing.Optional[str] — Find invoices by vendor name, invoice number, or amount. Partial matches are supported.

payer_id: typing.Optional[typing.Union[EntityId, typing.Sequence[EntityId]]] — Filter invoices by payer ID.

vendor_id: typing.Optional[typing.Union[EntityId, typing.Sequence[EntityId]]] — Filter invoices by vendor ID.

approver_id: typing.Optional[typing.Union[EntityUserId, typing.Sequence[EntityUserId]]] — Filter invoices by assigned approver user ID.

approver_action: typing.Optional[typing.Union[ApproverAction, typing.Sequence[ApproverAction]]] — Filter invoices by approver action. Needs to be used with approverId. For example, if you want to find all invoices that have been approved by a specific user, you would use approverId and approverAction=APPROVE.

invoice_id: typing.Optional[typing.Union[InvoiceId, typing.Sequence[InvoiceId]]] — Filter invoices by invoice ID.

status: typing.Optional[typing.Union[InvoiceStatus, typing.Sequence[InvoiceStatus]]] — Invoice status to filter on.

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.entity.invoice.metrics(...)

📝 Description

Get invoice metrics for an entity with the given filters. Invoices will be grouped by currency. If none of excludePayables, excludeReceivables, payerId, vendorId, or invoiceId status filters are provided, excludeReceivables will be set to true.

🔌 Usage

import datetime

from mercoa.client import Mercoa

client = Mercoa(
    token="YOUR_TOKEN",
)
client.entity.invoice.metrics(
    entity_id="ent_8545a84e-a45f-41bf-bdf1-33b42a55812c",
    return_by_date="CREATION_DATE",
    exclude_receivables=True,
    created_date_start=datetime.datetime.fromisoformat(
        "2021-01-01 00:00:00+00:00",
    ),
    created_date_end=datetime.datetime.fromisoformat(
        "2021-01-31 23:59:59.999000+00:00",
    ),
    currency="USD",
    status="NEW",
)

⚙️ Parameters

entity_id: EntityId — Entity ID or Entity ForeignID

search: typing.Optional[str] — Find invoices by vendor name, invoice number, or amount. Partial matches are supported.

exclude_payables: typing.Optional[bool] — Only return invoices that are not payable by the entity. This will return only invoices that are receivable by the entity.

exclude_receivables: typing.Optional[bool] — Only return invoices that are not receivable by the entity. This will return only invoices that are payable by the entity.

return_by_date: typing.Optional[InvoiceMetricsPerDateGroupBy] — Return invoice metrics grouped by date.

payer_id: typing.Optional[typing.Union[EntityId, typing.Sequence[EntityId]]] — Filter invoices by payer ID.

vendor_id: typing.Optional[typing.Union[EntityId, typing.Sequence[EntityId]]] — Filter invoices by vendor ID.

approver_id: typing.Optional[typing.Union[EntityUserId, typing.Sequence[EntityUserId]]] — Filter invoices by assigned approver user ID.

invoice_id: typing.Optional[typing.Union[InvoiceId, typing.Sequence[InvoiceId]]] — Filter invoices by invoice ID.

status: typing.Optional[typing.Union[InvoiceStatus, typing.Sequence[InvoiceStatus]]] — Invoice status to filter on

start_date: typing.Optional[dt.datetime] — Start date filter. Defaults to CREATED_AT unless specified the dateType is specified

end_date: typing.Optional[dt.datetime] — End date filter. Defaults to CREATED_AT unless specified the dateType is specified

date_type: typing.Optional[InvoiceDateFilter] — Type of date to filter by if startDate and endDate filters are provided. Defaults to CREATED_AT.

due_date_start: typing.Optional[dt.datetime] — DEPRECATED. Use startDate, endDate, and dateType instead. Start date for invoice dueDate filter.

due_date_end: typing.Optional[dt.datetime] — DEPRECATED. Use startDate, endDate, and dateType instead. End date for invoice dueDate filter.

created_date_start: typing.Optional[dt.datetime] — DEPRECATED. Use startDate, endDate, and dateType instead. Start date for invoice created on date filter.

created_date_end: typing.Optional[dt.datetime] — DEPRECATED. Use startDate, endDate, and dateType instead. End date for invoice created date filter.

currency: typing.Optional[typing.Union[CurrencyCode, typing.Sequence[CurrencyCode]]] — Currency to filter on

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

Entity Metadata

client.entity.metadata.get_all(...)

📝 Description

Retrieve all metadata options associated with this entity

🔌 Usage

from mercoa.client import Mercoa

client = Mercoa(
    token="YOUR_TOKEN",
)
client.entity.metadata.get_all(
    entity_id="ent_a0f6ea94-0761-4a5e-a416-3c453cb7eced",
)

⚙️ Parameters

entity_id: EntityId — Entity ID or Entity ForeignID

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.entity.metadata.get(...)

📝 Description

Retrieve metadata associated with a specific key

🔌 Usage

from mercoa.client import Mercoa

client = Mercoa(
    token="YOUR_TOKEN",
)
client.entity.metadata.get(
    entity_id="ent_a0f6ea94-0761-4a5e-a416-3c453cb7eced",
    key="projectId",
)

⚙️ Parameters

entity_id: EntityId — Entity ID or Entity ForeignID

key: str

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.entity.metadata.update(...)

📝 Description

Update metadata associated with a specific key

🔌 Usage

from mercoa.client import Mercoa

client = Mercoa(
    token="YOUR_TOKEN",
)
client.entity.metadata.update(
    entity_id="ent_a0f6ea94-0761-4a5e-a416-3c453cb7eced",
    key="projectId",
    request=["proj_123", "proj_456"],
)

⚙️ Parameters

entity_id: EntityId — Entity ID or Entity ForeignID

key: str

request: typing.Sequence[str]

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.entity.metadata.delete(...)

📝 Description

Delete all metadata associated with a specific key

🔌 Usage

from mercoa.client import Mercoa

client = Mercoa(
    token="YOUR_TOKEN",
)
client.entity.metadata.delete(
    entity_id="ent_a0f6ea94-0761-4a5e-a416-3c453cb7eced",
    key="propertyId",
)

⚙️ Parameters

entity_id: EntityId — Entity ID or Entity ForeignID

key: str

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

Entity NotificationPolicy

client.entity.notification_policy.get_all(...)

📝 Description

Retrieve all notification policies associated with this entity

🔌 Usage

from mercoa.client import Mercoa

client = Mercoa(
    token="YOUR_TOKEN",
)
client.entity.notification_policy.get_all(
    entity_id="ent_8545a84e-a45f-41bf-bdf1-33b42a55812c",
)

⚙️ Parameters

entity_id: EntityId — Entity ID or Entity ForeignID

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.entity.notification_policy.get(...)

📝 Description

Retrieve notification policy associated with this entity

🔌 Usage

from mercoa.client import Mercoa

client = Mercoa(
    token="YOUR_TOKEN",
)
client.entity.notification_policy.get(
    entity_id="ent_8545a84e-a45f-41bf-bdf1-33b42a55812c",
    notification_type="INVOICE_APPROVED",
)

⚙️ Parameters

entity_id: EntityId — Entity ID or Entity ForeignID

notification_type: NotificationType

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.entity.notification_policy.update(...)

📝 Description

Update notification policy associated with this entity

🔌 Usage

from mercoa import NotificationPolicyRequest
from mercoa.client import Mercoa

client = Mercoa(
    token="YOUR_TOKEN",
)
client.entity.notification_policy.update(
    entity_id="ent_8545a84e-a45f-41bf-bdf1-33b42a55812c",
    notification_type="INVOICE_APPROVED",
    request=NotificationPolicyRequest(
        disabled=True,
        additional_roles=[],
    ),
)

⚙️ Parameters

entity_id: EntityId — Entity ID or Entity ForeignID

notification_type: NotificationType

request: NotificationPolicyRequest

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

Entity PaymentMethod

client.entity.payment_method.get_all(...)

🔌 Usage

from mercoa.client import Mercoa

client = Mercoa(
    token="YOUR_TOKEN",
)
client.entity.payment_method.get_all(
    entity_id="ent_8545a84e-a45f-41bf-bdf1-33b42a55812c",
    type="bankAccount",
)

⚙️ Parameters

entity_id: EntityId — Entity ID or Entity ForeignID

type: typing.Optional[ typing.Union[PaymentMethodType, typing.Sequence[PaymentMethodType]] ] — Type of payment method to filter

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.entity.payment_method.create(...)

🔌 Usage

from mercoa import PaymentMethodRequest_Custom
from mercoa.client import Mercoa

client = Mercoa(
    token="YOUR_TOKEN",
)
client.entity.payment_method.create(
    entity_id="ent_21661ac1-a2a8-4465-a6c0-64474ba8181d",
    request=PaymentMethodRequest_Custom(
        foreign_id="DB_FOREIGN_ID",
        account_name="Vendor Wire Account",
        account_number="123456789",
        schema_id="cpms_4794d597-70dc-4fec-b6ec-c5988e759769",
        data={
            "bankName": "Chase",
            "recipientName": "John Doe",
            "routingNumber": "123456789",
            "accountNumber": "99988767623",
        },
    ),
)

⚙️ Parameters

entity_id: EntityId — Entity ID or Entity ForeignID

request: PaymentMethodRequest

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.entity.payment_method.get(...)

🔌 Usage

from mercoa.client import Mercoa

client = Mercoa(
    token="YOUR_TOKEN",
)
client.entity.payment_method.get(
    entity_id="ent_8545a84e-a45f-41bf-bdf1-33b42a55812c",
    payment_method_id="pm_4794d597-70dc-4fec-b6ec-c5988e759769",
)

⚙️ Parameters

entity_id: EntityId — Entity ID or Entity ForeignID

payment_method_id: PaymentMethodId — Payment Method ID or Payment Method ForeignID

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.entity.payment_method.update(...)

📝 Description

Only custom payment methods can be updated.

🔌 Usage

from mercoa import PaymentMethodUpdateRequest_BankAccount
from mercoa.client import Mercoa

client = Mercoa(
    token="YOUR_TOKEN",
)
client.entity.payment_method.update(
    entity_id="ent_8545a84e-a45f-41bf-bdf1-33b42a55812c",
    payment_method_id="pm_4794d597-70dc-4fec-b6ec-c5988e759769",
    request=PaymentMethodUpdateRequest_BankAccount(
        default_source=True,
        default_destination=True,
    ),
)

⚙️ Parameters

entity_id: EntityId — Entity ID or Entity ForeignID

payment_method_id: PaymentMethodId — Payment Method ID or Payment Method ForeignID

request: PaymentMethodUpdateRequest

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.entity.payment_method.delete(...)

📝 Description

Mark a payment method as inactive. This will not remove the payment method from the system, but will prevent it from being used in the future.

🔌 Usage

from mercoa.client import Mercoa

client = Mercoa(
    token="YOUR_TOKEN",
)
client.entity.payment_method.delete(
    entity_id="ent_8545a84e-a45f-41bf-bdf1-33b42a55812c",
    payment_method_id="pm_4794d597-70dc-4fec-b6ec-c5988e759769",
)

⚙️ Parameters

entity_id: EntityId — Entity ID or Entity ForeignID

payment_method_id: PaymentMethodId — Payment Method ID or Payment Method ForeignID

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.entity.payment_method.initiate_micro_deposits(...)

📝 Description

Initiate micro deposits for a bank account

🔌 Usage

from mercoa.client import Mercoa

client = Mercoa(
    token="YOUR_TOKEN",
)
client.entity.payment_method.initiate_micro_deposits(
    entity_id="ent_8545a84e-a45f-41bf-bdf1-33b42a55812c",
    payment_method_id="pm_4794d597-70dc-4fec-b6ec-c5988e759769",
)

⚙️ Parameters

entity_id: EntityId — Entity ID or Entity ForeignID

payment_method_id: PaymentMethodId — Payment Method ID or Payment Method ForeignID

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.entity.payment_method.complete_micro_deposits(...)

📝 Description

Complete micro deposit verification

🔌 Usage

from mercoa.client import Mercoa

client = Mercoa(
    token="YOUR_TOKEN",
)
client.entity.payment_method.complete_micro_deposits(
    entity_id="ent_8545a84e-a45f-41bf-bdf1-33b42a55812c",
    payment_method_id="pm_4794d597-70dc-4fec-b6ec-c5988e759769",
    amounts=[40, 2],
)

⚙️ Parameters

entity_id: EntityId — Entity ID or Entity ForeignID

payment_method_id: PaymentMethodId — Payment Method ID or Payment Method ForeignID

amounts: typing.Sequence[int] — The amounts of the micro deposits in cents

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.entity.payment_method.get_balance(...)

📝 Description

Deprecated. Get the available balance of a payment method. Only bank accounts added with Plaid are supported. This endpoint will return a cached value and will refresh the balance when called.

🔌 Usage

from mercoa.client import Mercoa

client = Mercoa(
    token="YOUR_TOKEN",
)
client.entity.payment_method.get_balance(
    entity_id="string",
    payment_method_id="string",
)

⚙️ Parameters

entity_id: EntityId — Entity ID or Entity ForeignID

payment_method_id: PaymentMethodId — Payment Method ID or Payment Method ForeignID

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

Entity Representative

client.entity.representative.get_all(...)

📝 Description

Get representatives for an entity

🔌 Usage

from mercoa.client import Mercoa

client = Mercoa(
    token="YOUR_TOKEN",
)
client.entity.representative.get_all(
    entity_id="ent_8545a84e-a45f-41bf-bdf1-33b42a55812c",
)

⚙️ Parameters

entity_id: EntityId — Entity ID or Entity ForeignID

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.entity.representative.create(...)

🔌 Usage

from mercoa import (
    Address,
    BirthDate,
    FullName,
    IndividualGovernmentId,
    PhoneNumber,
    RepresentativeRequest,
    Responsibilities,
)
from mercoa.client import Mercoa

client = Mercoa(
    token="YOUR_TOKEN",
)
client.entity.representative.create(
    entity_id="ent_8545a84e-a45f-41bf-bdf1-33b42a55812c",
    request=RepresentativeRequest(
        name=FullName(
            first_name="John",
            middle_name="Quincy",
            last_name="Adams",
            suffix="Jr.",
        ),
        phone=PhoneNumber(
            country_code="1",
            number="4155551234",
        ),
        email="john.doe@acme.com",
        address=Address(
            address_line_1="123 Main St",
            address_line_2="Unit 1",
            city="San Francisco",
            state_or_province="CA",
            postal_code="94105",
            country="US",
        ),
        birth_date=BirthDate(
            day="1",
            month="1",
            year="1980",
        ),
        government_id=IndividualGovernmentId(
            ssn="123-45-6789",
        ),
        responsibilities=Responsibilities(
            is_owner=True,
            ownership_percentage=40,
            is_controller=True,
        ),
    ),
)

⚙️ Parameters

entity_id: EntityId — Entity ID or Entity ForeignID

request: RepresentativeRequest

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.entity.representative.get(...)

🔌 Usage

from mercoa.client import Mercoa

client = Mercoa(
    token="YOUR_TOKEN",
)
client.entity.representative.get(
    entity_id="ent_8545a84e-a45f-41bf-bdf1-33b42a55812c",
    representative_id="rep_7df2974a-4069-454c-912f-7e58ebe030fb",
)

⚙️ Parameters

entity_id: EntityId — Entity ID or Entity ForeignID

representative_id: RepresentativeId

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.entity.representative.delete(...)

🔌 Usage

from mercoa.client import Mercoa

client = Mercoa(
    token="YOUR_TOKEN",
)
client.entity.representative.delete(
    entity_id="ent_8545a84e-a45f-41bf-bdf1-33b42a55812c",
    representative_id="rep_7df2974a-4069-454c-912f-7e58ebe030fb",
)

⚙️ Parameters

entity_id: EntityId — Entity ID or Entity ForeignID

representative_id: RepresentativeId

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

Entity User NotificationPolicy

client.entity.user.notification_policy.get_all(...)

📝 Description

Retrieve all notification policies associated with this entity user

🔌 Usage

from mercoa.client import Mercoa

client = Mercoa(
    token="YOUR_TOKEN",
)
client.entity.user.notification_policy.get_all(
    entity_id="ent_8545a84e-a45f-41bf-bdf1-33b42a55812c",
    user_id="user_e24fc81c-c5ee-47e8-af42-4fe29d895506",
)

⚙️ Parameters

entity_id: EntityId — Entity ID or Entity ForeignID

user_id: EntityUserId

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.entity.user.notification_policy.get(...)

📝 Description

Retrieve notification policy associated with this entity user

🔌 Usage

from mercoa.client import Mercoa

client = Mercoa(
    token="YOUR_TOKEN",
)
client.entity.user.notification_policy.get(
    entity_id="ent_8545a84e-a45f-41bf-bdf1-33b42a55812c",
    user_id="user_e24fc81c-c5ee-47e8-af42-4fe29d895506",
    notification_type="INVOICE_PAID",
)

⚙️ Parameters

entity_id: EntityId — Entity ID or Entity ForeignID

user_id: EntityUserId

notification_type: NotificationType

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.entity.user.notification_policy.update(...)

📝 Description

Update notification policy associated with this entity user

🔌 Usage

from mercoa import UserNotificationPolicyRequest
from mercoa.client import Mercoa

client = Mercoa(
    token="YOUR_TOKEN",
)
client.entity.user.notification_policy.update(
    entity_id="ent_8545a84e-a45f-41bf-bdf1-33b42a55812c",
    user_id="user_e24fc81c-c5ee-47e8-af42-4fe29d895506",
    notification_type="INVOICE_PAID",
    request=UserNotificationPolicyRequest(
        immediate=True,
    ),
)

⚙️ Parameters

entity_id: EntityId — Entity ID or Entity ForeignID

user_id: EntityUserId

notification_type: NotificationType

request: UserNotificationPolicyRequest

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

Entity User Notifications

client.entity.user.notifications.find(...)

🔌 Usage

from mercoa.client import Mercoa

client = Mercoa(
    token="YOUR_TOKEN",
)
client.entity.user.notifications.find(
    entity_id="ent_8545a84e-a45f-41bf-bdf1-33b42a55812c",
    user_id="user_e24fc81c-c5ee-47e8-af42-4fe29d895506",
)

⚙️ Parameters

entity_id: EntityId — Entity ID or Entity ForeignID

user_id: EntityUserId

start_date: typing.Optional[dt.datetime] — Start date for notification created on date filter.

end_date: typing.Optional[dt.datetime] — End date for notification created date filter.

order_direction: typing.Optional[OrderDirection] — Direction to order notifications by. Defaults to asc.

limit: typing.Optional[int] — Number of invoices to return. Limit can range between 1 and 100, and the default is 10.

starting_after: typing.Optional[NotificationId] — The ID of the notification to start after. If not provided, the first page of invoices will be returned.

notification_type: typing.Optional[ typing.Union[NotificationType, typing.Sequence[NotificationType]] ] — The type of notification to filter by.

status: typing.Optional[NotificationStatus] — The status of the notification to filter by.

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.entity.user.notifications.get(...)

🔌 Usage

from mercoa.client import Mercoa

client = Mercoa(
    token="YOUR_TOKEN",
)
client.entity.user.notifications.get(
    entity_id="ent_8545a84e-a45f-41bf-bdf1-33b42a55812c",
    user_id="user_e24fc81c-c5ee-47e8-af42-4fe29d895506",
    notification_id="notif_7df2974a-4069-454c-912f-7e58ebe030fb",
)

⚙️ Parameters

entity_id: EntityId — Entity ID or Entity ForeignID

user_id: EntityUserId

notification_id: NotificationId

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.entity.user.notifications.update(...)

📝 Description

Update the status of a notification.

🔌 Usage

from mercoa import NotificationUpdateRequest
from mercoa.client import Mercoa

client = Mercoa(
    token="YOUR_TOKEN",
)
client.entity.user.notifications.update(
    entity_id="ent_8545a84e-a45f-41bf-bdf1-33b42a55812c",
    user_id="user_e24fc81c-c5ee-47e8-af42-4fe29d895506",
    notification_id="notif_7df2974a-4069-454c-912f-7e58ebe030fb",
    request=NotificationUpdateRequest(
        status="READ",
    ),
)

⚙️ Parameters

entity_id: EntityId — Entity ID or Entity ForeignID

user_id: EntityUserId

notification_id: NotificationId

request: NotificationUpdateRequest

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

Invoice Approval

client.invoice.approval.add_approver(...)

📝 Description

Adds an approver to the invoice. Will select the first available approver slot that is not already filled and assign the approver to it. If no approver slots are available, an error will be returned. An explicit approver slot can be specified by setting the approverSlot field.

🔌 Usage

from mercoa import AddApproverRequest
from mercoa.client import Mercoa

client = Mercoa(
    token="YOUR_TOKEN",
)
client.invoice.approval.add_approver(
    invoice_id="inv_3d61faa9-1754-4b7b-9fcb-88ff97f368ff",
    request=AddApproverRequest(
        approval_slot_id="inap_9bb311c9-7c15-4c9e-8148-63814e0abec6",
        user_id="user_e24fc81c-c5ee-47e8-af42-4fe29d895506",
    ),
)

⚙️ Parameters

invoice_id: InvoiceId — Invoice ID or Invoice ForeignID

request: AddApproverRequest

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.invoice.approval.approve(...)

🔌 Usage

from mercoa import ApprovalRequest
from mercoa.client import Mercoa

client = Mercoa(
    token="YOUR_TOKEN",
)
client.invoice.approval.approve(
    invoice_id="inv_3d61faa9-1754-4b7b-9fcb-88ff97f368ff",
    request=ApprovalRequest(
        text="This is a reason for my action",
        user_id="user_e24fc81c-c5ee-47e8-af42-4fe29d895506",
    ),
)

⚙️ Parameters

invoice_id: InvoiceId — Invoice ID or Invoice ForeignID

request: ApprovalRequest

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.invoice.approval.reject(...)

🔌 Usage

from mercoa import ApprovalRequest
from mercoa.client import Mercoa

client = Mercoa(
    token="YOUR_TOKEN",
)
client.invoice.approval.reject(
    invoice_id="inv_3d61faa9-1754-4b7b-9fcb-88ff97f368ff",
    request=ApprovalRequest(
        text="This is a reason for my action",
        user_id="user_e24fc81c-c5ee-47e8-af42-4fe29d895506",
    ),
)

⚙️ Parameters

invoice_id: InvoiceId — Invoice ID or Invoice ForeignID

request: ApprovalRequest

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

Invoice Comment

client.invoice.comment.get_all(...)

📝 Description

Get all comments associated with this invoice

🔌 Usage

from mercoa.client import Mercoa

client = Mercoa(
    token="YOUR_TOKEN",
)
client.invoice.comment.get_all(
    invoice_id="inv_3d61faa9-1754-4b7b-9fcb-88ff97f368ff",
)

⚙️ Parameters

invoice_id: InvoiceId — Invoice ID or Invoice ForeignID

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.invoice.comment.create(...)

📝 Description

Add a comment to this invoice

🔌 Usage

from mercoa import CommentRequest
from mercoa.client import Mercoa

client = Mercoa(
    token="YOUR_TOKEN",
)
client.invoice.comment.create(
    invoice_id="inv_3d61faa9-1754-4b7b-9fcb-88ff97f368ff",
    request=CommentRequest(
        text="This is a comment",
        user_id="user_e24fc81c-c5ee-47e8-af42-4fe29d895506",
    ),
)

⚙️ Parameters

invoice_id: InvoiceId — Invoice ID or Invoice ForeignID

request: CommentRequest

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.invoice.comment.get(...)

🔌 Usage

from mercoa.client import Mercoa

client = Mercoa(
    token="YOUR_TOKEN",
)
client.invoice.comment.get(
    invoice_id="inv_3d61faa9-1754-4b7b-9fcb-88ff97f368ff",
    comment_id="ic_3d61faa9-1754-4b7b-9fcb-88ff97f368ff",
)

⚙️ Parameters

invoice_id: InvoiceId — Invoice ID or Invoice ForeignID

comment_id: CommentId

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.invoice.comment.update(...)

📝 Description

Edit a comment on this invoice

🔌 Usage

from mercoa import CommentRequest
from mercoa.client import Mercoa

client = Mercoa(
    token="YOUR_TOKEN",
)
client.invoice.comment.update(
    invoice_id="inv_3d61faa9-1754-4b7b-9fcb-88ff97f368ff",
    comment_id="ic_3d61faa9-1754-4b7b-9fcb-88ff97f368ff",
    request=CommentRequest(
        text="This is a comment",
        user_id="user_e24fc81c-c5ee-47e8-af42-4fe29d895506",
    ),
)

⚙️ Parameters

invoice_id: InvoiceId — Invoice ID or Invoice ForeignID

comment_id: CommentId

request: CommentRequest

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.invoice.comment.delete(...)

📝 Description

Delete a comment on this invoice

🔌 Usage

from mercoa.client import Mercoa

client = Mercoa(
    token="YOUR_TOKEN",
)
client.invoice.comment.delete(
    invoice_id="inv_3d61faa9-1754-4b7b-9fcb-88ff97f368ff",
    comment_id="ic_3d61faa9-1754-4b7b-9fcb-88ff97f368ff",
)

⚙️ Parameters

invoice_id: InvoiceId — Invoice ID or Invoice ForeignID

comment_id: CommentId

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

Invoice Document

client.invoice.document.get_all(...)

📝 Description

Get attachments (scanned/uploaded PDFs and images) associated with this invoice

🔌 Usage

from mercoa.client import Mercoa

client = Mercoa(
    token="YOUR_TOKEN",
)
client.invoice.document.get_all(
    invoice_id="inv_26e7b5d3-a739-4b23-9ad9-6aaa085f47a9",
)

⚙️ Parameters

invoice_id: InvoiceId — Invoice ID or Invoice ForeignID

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.invoice.document.upload(...)

📝 Description

Upload documents (scanned/uploaded PDFs and images) associated with this Invoice

🔌 Usage

from mercoa.client import Mercoa

client = Mercoa(
    token="YOUR_TOKEN",
)
client.invoice.document.upload(
    invoice_id="inv_26e7b5d3-a739-4b23-9ad9-6aaa085f47a9",
    document="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAIAQMAAAD+wSzIAAAABlBMVEX///+/v7+jQ3Y5AAAADklEQVQI12P4AIX8EAgALgAD/aNpbtEAAAAASUVORK5CYII",
)

⚙️ Parameters

invoice_id: InvoiceId — Invoice ID or Invoice ForeignID

document: str — Base64 encoded image or PDF of invoice document. PNG, JPG, WEBP, and PDF are supported. 10MB max.

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.invoice.document.delete(...)

📝 Description

Delete an attachment (scanned/uploaded PDFs and images) associated with this invoice

🔌 Usage

from mercoa.client import Mercoa

client = Mercoa(
    token="YOUR_TOKEN",
)
client.invoice.document.delete(
    invoice_id="inv_26e7b5d3-a739-4b23-9ad9-6aaa085f47a9",
    document_id="doc_37e6af0a-e637-48fd-b825-d6947b38c4e2",
)

⚙️ Parameters

invoice_id: InvoiceId — Invoice ID or Invoice ForeignID

document_id: str

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.invoice.document.generate_invoice_pdf(...)

📝 Description

Generate a PDF of the invoice. This PDF is generated from the data in the invoice, not from the uploaded documents.

🔌 Usage

from mercoa.client import Mercoa

client = Mercoa(
    token="YOUR_TOKEN",
)
client.invoice.document.generate_invoice_pdf(
    invoice_id="inv_26e7b5d3-a739-4b23-9ad9-6aaa085f47a9",
)

⚙️ Parameters

invoice_id: InvoiceId — Invoice ID or Invoice ForeignID

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.invoice.document.generate_check_pdf(...)

📝 Description

Get a PDF of the check for the invoice. If the invoice does not have check as the disbursement method, an error will be returned. If the disbursement option for the check is set to 'MAIL', a void copy of the check will be returned. If the disbursement option for the check is set to 'PRINT', a printable check will be returned. If the invoice is NOT marked as PAID, the check will be a void copy.

🔌 Usage

from mercoa.client import Mercoa

client = Mercoa(
    token="YOUR_TOKEN",
)
client.invoice.document.generate_check_pdf(
    invoice_id="inv_26e7b5d3-a739-4b23-9ad9-6aaa085f47a9",
)

⚙️ Parameters

invoice_id: InvoiceId — Invoice ID or Invoice ForeignID

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.invoice.document.get_source_email(...)

📝 Description

Get the email subject and body that was used to create this invoice.

🔌 Usage

from mercoa.client import Mercoa

client = Mercoa(
    token="YOUR_TOKEN",
)
client.invoice.document.get_source_email(
    invoice_id="inv_26e7b5d3-a739-4b23-9ad9-6aaa085f47a9",
)

⚙️ Parameters

invoice_id: InvoiceId — Invoice ID or Invoice ForeignID

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

Invoice PaymentLinks

client.invoice.payment_links.get_payer_link(...)

📝 Description

Get temporary link for payer to send payment

🔌 Usage

from mercoa.client import Mercoa

client = Mercoa(
    token="YOUR_TOKEN",
)
client.invoice.payment_links.get_payer_link(
    invoice_id="inv_a0f6ea94-0761-4a5e-a416-3c453cb7eced",
)

⚙️ Parameters

invoice_id: InvoiceId — Invoice ID or Invoice ForeignID

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.invoice.payment_links.send_payer_email(...)

📝 Description

Trigger email to payer inviting them to make payment

🔌 Usage

from mercoa.client import Mercoa

client = Mercoa(
    token="YOUR_TOKEN",
)
client.invoice.payment_links.send_payer_email(
    invoice_id="inv_a0f6ea94-0761-4a5e-a416-3c453cb7eced",
    attach_invoice=True,
)

⚙️ Parameters

invoice_id: InvoiceId — Invoice ID or Invoice ForeignID

attach_invoice: typing.Optional[bool] — Whether to attach the invoice to the email

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.invoice.payment_links.get_vendor_link(...)

📝 Description

Get temporary link for vendor to accept payment

🔌 Usage

from mercoa.client import Mercoa

client = Mercoa(
    token="YOUR_TOKEN",
)
client.invoice.payment_links.get_vendor_link(
    invoice_id="inv_a0f6ea94-0761-4a5e-a416-3c453cb7eced",
)

⚙️ Parameters

invoice_id: InvoiceId — Invoice ID or Invoice ForeignID

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.invoice.payment_links.send_vendor_email(...)

📝 Description

Trigger email to vendor inviting them into the vendor portal

🔌 Usage

from mercoa.client import Mercoa

client = Mercoa(
    token="YOUR_TOKEN",
)
client.invoice.payment_links.send_vendor_email(
    invoice_id="inv_a0f6ea94-0761-4a5e-a416-3c453cb7eced",
)

⚙️ Parameters

invoice_id: InvoiceId — Invoice ID or Invoice ForeignID

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

Ocr

client.ocr.ocr(...)

📝 Description

Run OCR on an Base64 encoded image or PDF. This endpoint will block until the OCR is complete.

🔌 Usage

from mercoa import OcrRequest
from mercoa.client import Mercoa

client = Mercoa(
    token="YOUR_TOKEN",
)
client.ocr.ocr(
    request=OcrRequest(
        vendor_network="entity",
        entity_id="entity_8f86116b-3b4d-4ded-99ef-3bc929d8c33c",
        mime_type="image/png",
        image="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAIAQMAAAD+wSzIAAAABlBMVEX///+/v7+jQ3Y5AAAADklEQVQI12P4AIX8EAgALgAD/aNpbtEAAAAASUVORK5CYII",
    ),
)

⚙️ Parameters

request: OcrRequest

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.ocr.run_async_ocr(...)

📝 Description

Run OCR on an Base64 encoded image or PDF. This endpoint will return immediately and the OCR will be processed asynchronously.

🔌 Usage

from mercoa import OcrRequest
from mercoa.client import Mercoa

client = Mercoa(
    token="YOUR_TOKEN",
)
client.ocr.run_async_ocr(
    request=OcrRequest(
        vendor_network="entity",
        entity_id="entity_8f86116b-3b4d-4ded-99ef-3bc929d8c33c",
        mime_type="image/png",
        image="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAIAQMAAAD+wSzIAAAABlBMVEX///+/v7+jQ3Y5AAAADklEQVQI12P4AIX8EAgALgAD/aNpbtEAAAAASUVORK5CYII",
    ),
)

⚙️ Parameters

request: OcrRequest

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.ocr.get_async_ocr(...)

📝 Description

Get the status and results of an asynchronous OCR job.

🔌 Usage

from mercoa.client import Mercoa

client = Mercoa(
    token="YOUR_TOKEN",
)
client.ocr.get_async_ocr(
    job_id="ocr_8f86116b-3b4d-4ded-99ef-3bc929d8c33c",
)

⚙️ Parameters

job_id: str

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

Organization NotificationConfiguration

client.organization.notification_configuration.get_all()

📝 Description

Retrieve all notification configurations

🔌 Usage

from mercoa.client import Mercoa

client = Mercoa(
    token="YOUR_TOKEN",
)
client.organization.notification_configuration.get_all()

⚙️ Parameters

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.organization.notification_configuration.get(...)

📝 Description

Retrieve notification configuration for this notification type

🔌 Usage

from mercoa.client import Mercoa

client = Mercoa(
    token="YOUR_TOKEN",
)
client.organization.notification_configuration.get(
    notification_type="INVOICE_APPROVAL_NEEDED",
)

⚙️ Parameters

notification_type: NotificationType

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.organization.notification_configuration.update(...)

📝 Description

Update notification configuration for this notification type

🔌 Usage

from mercoa import NotificationConfigurationRequest_Invoice
from mercoa.client import Mercoa

client = Mercoa(
    token="YOUR_TOKEN",
)
client.organization.notification_configuration.update(
    notification_type="INVOICE_APPROVAL_NEEDED",
    request=NotificationConfigurationRequest_Invoice(
        url="string",
    ),
)

⚙️ Parameters

notification_type: NotificationType

request: NotificationConfigurationRequest

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

client.organization.notification_configuration.reset(...)

📝 Description

Reset notification configuration for this notification type

🔌 Usage

from mercoa.client import Mercoa

client = Mercoa(
    token="YOUR_TOKEN",
)
client.organization.notification_configuration.reset(
    notification_type="INVOICE_APPROVAL_NEEDED",
)

⚙️ Parameters

notification_type: NotificationType

request_options: typing.Optional[RequestOptions] — Request-specific configuration.

PaymentMethods

client.payment_methods.find(...)

🔌 Usage

from mercoa.client import Mercoa

client = Mercoa(
    token="YOUR_TOKEN",
)
client.payment_methods.find(
    entity_id="ent_8545a84e-a45f-41bf-bdf1-33b42a55812c",
)

⚙️ Parameters

limit: typing.Optional[int] — Number of payment methods to return. Limit can range between 1 and 100, and the default is 10.

starting_after: typing.Optional[PaymentMethodId] — The ID of the payment method to start after. If not provided, the first page of payment methods will be returned.

type: typing.Optional[ typing.Union[PaymentMethodType, typing.Sequence[PaymentMethodType]] ] — Type of payment method to filter

entity_id: typing.Optional[typing.Union[EntityId, typing.Sequence[EntityId]]] — Entity ID to filter

request_options: typing.Optional[RequestOptions] — Request-specific configuration.