# Melio

> Review entities, accounts and payouts with the Melio Payouts API.

App · 12 actions. Web page: https://docs.lodol.com/docs/integrations/melio

## Actions

### Calculate fees

Estimates the fees for a payment between two of the entity's accounts, without creating one. Fees depend on the originating account, the receiving account, the `deliveryPreference`, and the `amount`. All amounts are in minor units (cents). For a payment that converts currency this prices the fees only; use `POST /tools/fx-quote` for the exchange rate and the amount that would be debited.

**Inputs**

- Melio entity (`melio_entity_id`, text, required): Choose the Melio entity for this step.
- Originating account (`originating_account_id`, text, required): Internal originating account id (acct_ ), the debit account
- Receiving account (`receiving_account_id`, text, required): External receiving account id (acct_ ), the credit account
- Delivery preference (`delivery_preference`, text, required): Choose a delivery option supported by the receiving account. One of: `standard-ach`, `same-day-ach`, `rtp`, `standard-check`, `express-check`, `overnight-check`, `domestic-wire`, `instant-domestic-wire`, `virtual-card`, `instant-virtual-card`, and 4 more.
- Amount (`amount`, number, required): Amount in the currency’s smallest unit, such as cents for USD.
- Currency (`currency`, text): Must match the receiving account's currency, exactly as on `POST /payments`. Default: `USD`.

**Outputs**

- `data` (list): The response from Melio.

**Example output**

```json
{
  "data": []
}
```

### Check fast payment eligibility

Checks which faster-than-standard delivery options a payment between two of the entity's accounts is eligible for, without creating one. Eligibility depends on the originating account, the receiving account, and the `amount` (minor units, cents). The response has one entry per fast option valid for the receiving account and the originating account's funding type, for example `same-day-ach` and `rtp` for ACH, or `express-check` and `overnight-check` for check. With a card originating account the collect is immediate, so `same-day-ach` and `insta

**Inputs**

- Melio entity (`melio_entity_id`, text, required): Choose the Melio entity for this step.
- Originating account (`originating_account_id`, text, required): Internal originating account id (acct_ ), the debit account
- Receiving account (`receiving_account_id`, text, required): External receiving account id (acct_ ), the credit account
- Amount (`amount`, number, required): Amount in the currency’s smallest unit, such as cents for USD.
- Currency (`currency`, text): Currency. Default: `USD`.

**Outputs**

- `data` (object): The response from Melio.

**Example output**

```json
{
  "data": {
    "amount": 1,
    "currency": "example",
    "eligibilities": [],
    "originatingAccountId": "example",
    "receivingAccountId": "example"
  }
}
```

### Estimate delivery dates

Estimates when a payment between two of the entity's accounts would be delivered, without creating one. The response has one estimate per delivery option valid for the receiving account and the originating account's funding type, for example `standard-ach`, `same-day-ach`, and `rtp` for ACH with a bank originating account, or `same-day-ach` and `rtp` with a card. `deductionDate` is the debit date used for the estimate (defaults to today); `amount` is in minor units (cents).

**Inputs**

- Melio entity (`melio_entity_id`, text, required): Choose the Melio entity for this step.
- Originating account (`originating_account_id`, text, required): Internal originating account id (acct_ ), the debit account
- Receiving account (`receiving_account_id`, text, required): External receiving account id (acct_ ), the credit account
- Amount (`amount`, number, required): Amount in the currency’s smallest unit, such as cents for USD.
- Deduction date (`deduction_date`, date): The debit/schedule date the estimate is based on. Defaults to the current date when omitted.
- Currency (`currency`, text): Currency. Default: `USD`.

**Outputs**

- `data` (object): The response from Melio.

**Example output**

```json
{
  "data": {
    "amount": 1,
    "currency": "example",
    "deductionDate": "example",
    "estimates": [],
    "originatingAccountId": "example",
    "receivingAccountId": "example"
  }
}
```

### Get account

Returns a single account. If it's an internal Plaid account that isn't yet verified, its verification status is refreshed from Plaid before the response is returned.

**Inputs**

- Melio entity (`melio_entity_id`, text, required): Choose the Melio entity for this step.
- Account (`account_id`, text, required): Choose a record from the connected account.

**Outputs**

- `data` (object): The response from Melio.

**Example output**

```json
{
  "data": {
    "bankAccount": {
      "accountNumberLast4": "example",
      "accountType": "checking",
      "routingNumber": "example"
    },
    "card": {
      "expiration": "example",
      "lastFourDigits": "example",
      "network": "example"
    },
    "counterPartyEmail": "example",
    "counterPartyName": "example",
    "createdAt": "example",
    "domesticWire": {
      "accountNumberLast4": "example",
      "address": {
        "aptNumber": "example",
        "city": "example",
        "countryCode": "example",
        "line1": "example",
        "line2": "example",
        "postalCode": "example",
        "state": "example"
      },
      "routingNumber": "example"
    },
    "externalId": "example",
    "id": "example",
    "internationalFx": {
      "accountIdentifierLast4": "example",
      "address": {
        "aptNumber": "example",
        "city": "example",
        "countryCode": "example",
        "line1": "example",
        "line2": "example",
        "postalCode": "example",
        "state": "example"
      },
      "bankCountryCode": "example",
      "bankName": "example",
      "currency": "example"
    },
    "internationalGusd": {
      "walletAddressLast4": "example"
    },
    "isVerified": false,
    "metadata": {},
    "nickname": "example",
    "ownershipType": "internal",
    "paperCheck": {
      "address": {
        "aptNumber": "example",
        "city": "example",
        "countryCode": "example",
        "line1": "example",
        "line2": "example",
        "postalCode": "example",
        "state": "example"
      },
      "printName": "example"
    },
    "type": "ach",
    "updatedAt": "example"
  }
}
```

### Get account setup link

Returns a short-lived link you hand to the entity. Opening it takes them to a Melio-hosted page that runs the Plaid or card flow and adds the internal account for them, so bank and card details never pass through your servers. Authenticate with your api-key.

**Inputs**

- Melio entity (`melio_entity_id`, text, required): Choose the Melio entity for this step.
- Type (`type`, text, required): Type. One of: `plaid`, `card`.
- External ID (`external_id`, text): Your own unique identifier for the account. When set, the account created through this link is pinned to this externalId; the submitter cannot supply a different one.

**Outputs**

- `data` (object): The response from Melio.

**Example output**

```json
{
  "data": {
    "data": {
      "expiration": "example",
      "url": "example"
    }
  }
}
```

### Get account verification link

For an unverified internal Plaid account, returns a short-lived link you hand to the entity. Opening it takes them to a Melio-hosted page where they complete same-day micro-deposit verification in Plaid. Authenticate with your api-key.

**Inputs**

- Melio entity (`melio_entity_id`, text, required): Choose the Melio entity for this step.
- Account (`account_id`, text, required): Choose a record from the connected account.

**Outputs**

- `data` (object): The response from Melio.

**Example output**

```json
{
  "data": {
    "data": {
      "expiration": "example",
      "url": "example"
    }
  }
}
```

### Get entity

Get entity.

**Inputs**

- Entity (`entity_id`, text, required): An entity id (ent_ ) or the sentinel `me` (the partner's sole entity).

**Outputs**

- `data` (object): The response from Melio.

**Example output**

```json
{
  "data": {
    "address": {
      "aptNumber": "example",
      "city": "example",
      "countryCode": "example",
      "line1": "example",
      "line2": "example",
      "postalCode": "example",
      "state": "example"
    },
    "businessType": "example",
    "contact": {
      "firstName": "example",
      "lastName": "example"
    },
    "createdAt": "example",
    "description": "example",
    "externalId": "example",
    "id": "example",
    "industry": {
      "naicsCode": "example",
      "name": "example"
    },
    "legalAddress": {
      "aptNumber": "example",
      "city": "example",
      "countryCode": "example",
      "line1": "example",
      "line2": "example",
      "postalCode": "example",
      "state": "example"
    },
    "legalName": "example",
    "metadata": {},
    "name": "example",
    "owner": {
      "email": "example",
      "firstName": "example",
      "lastName": "example"
    },
    "phoneNumber": "example",
    "taxInfo": {
      "identifierLast4": "example",
      "type": "ein"
    },
    "termsAcceptance": {
      "acceptedAt": "example"
    },
    "type": "business",
    "updatedAt": "example",
    "website": "example"
  }
}
```

### Get limitations

Returns the entity's per-operation capabilities. Each operation (named `resource.subtype:action`) is either allowed or, if not, lists the reasons why (for example, missing information). Only write operations can be limited; read operations are always allowed and are not listed.

**Inputs**

- Melio entity (`melio_entity_id`, text, required): Choose the Melio entity for this step.

**Outputs**

- `data` (object): The business's per-operation capabilities. Every entry reports whether a write operation (create/update/delete) is allowed today and, if not, why. Only limitable operations are listed; read operations are always allowed and never appear. New operations will be added over time.

**Example output**

```json
{
  "data": {
    "capabilities": []
  }
}
```

### Get payment

Returns a single payment by its Melio id (`pay_ `). To look one up by your own identifier instead, list payments with `?externalId=`.

**Inputs**

- Melio entity (`melio_entity_id`, text, required): Choose the Melio entity for this step.
- Payment (`payment_id`, text, required): Choose a record from the connected account.

**Outputs**

- `data` (object): The response from Melio.

**Example output**

```json
{
  "data": {
    "amount": 1,
    "createdAt": "example",
    "currency": "example",
    "deductionDate": "example",
    "deliveryDate": "example",
    "deliveryPreference": "standard-ach",
    "externalId": "example",
    "failureReason": {
      "code": "R01_INSUFFICIENT_FUNDS",
      "message": "example",
      "type": "failed-to-collect"
    },
    "fees": [],
    "id": "example",
    "metadata": {},
    "noteToRecipient": "example",
    "noteToSelf": "example",
    "originatingAccountId": "example",
    "receiverUpgrade": {
      "upgradedFromDeliveryPreference": "standard-ach",
      "upgradedFromReceivingAccountId": "example"
    },
    "receivingAccountId": "example",
    "status": "scheduled",
    "tracking": "example",
    "updatedAt": "example"
  }
}
```

### List accounts

Returns the entity's accounts. Any internal Plaid account that isn't yet verified has its verification status refreshed from Plaid before the response is returned.

**Inputs**

- Melio entity (`melio_entity_id`, text, required): Choose the Melio entity for this step.
- Ownership type (`ownership_type`, text): Ownership type. One of: `internal`, `external`.
- Type (`type`, text): Type. One of: `ach`, `check`, `card`, `domestic-wire`, `virtual-card`, `counterparty-choice`.
- External ID (`external_id`, text): Return only the account whose `externalId` matches (your own id).
- Limit (`limit`, number): Limit. From 1 to 50.
- Starting after (`starting_after`, text): Starting after.
- Ending before (`ending_before`, text): Ending before.

**Outputs**

- `data` (object): The response from Melio.

**Example output**

```json
{
  "data": {
    "data": [],
    "hasMore": false
  }
}
```

### List entities

Returns your entities, newest first. Use the filters below to narrow the list.

**Inputs**

- External ID (`external_id`, text): Return only the entity whose `externalId` matches (your own id).
- Limit (`limit`, number): Limit. From 1 to 50.
- Starting after (`starting_after`, text): Starting after.
- Ending before (`ending_before`, text): Ending before.

**Outputs**

- `data` (object): The response from Melio.

**Example output**

```json
{
  "data": {
    "data": [],
    "hasMore": false
  }
}
```

### List payments

Returns the entity's payments, newest first. Use the filters below to narrow the list; they can be combined with each other and with pagination.

**Inputs**

- Melio entity (`melio_entity_id`, text, required): Choose the Melio entity for this step.
- Limit (`limit`, number): Maximum number of resources to return, 1 to 50. Defaults to 50. From 1 to 50. Default: `50`.
- Starting after (`starting_after`, text): Cursor for forward (older) pagination: a resource id. The page returned starts immediately after this resource. Mutually exclusive with `endingBefore`.
- Ending before (`ending_before`, text): Cursor for backward (newer) pagination: a resource id. The page returned ends immediately before this resource. Mutually exclusive with `startingAfter`.
- External ID (`external_id`, text): Return only the payment whose `externalId` matches (your own id).
- Status (`status`, text): Filter by payment status. One of: `scheduled`, `in-progress`, `completed`, `failed`, `canceled`.
- Originating account (`originating_account_id`, text): Return only payments drawn from this internal originating account (acct_ ).
- Receiving account (`receiving_account_id`, text): Return only payments sent to this external receiving account (acct_ ).
- Created gte (`created_gte`, date and time): Return payments created at or after this RFC 3339 timestamp.
- Created lte (`created_lte`, date and time): Return payments created at or before this RFC 3339 timestamp.

**Outputs**

- `data` (object): The response from Melio.

**Example output**

```json
{
  "data": {
    "data": [],
    "hasMore": false
  }
}
```
