Bank accounts (Portal)

Sweep the available balance to the bank account

Moves everything currently available in the payment provider's ledger out to this bank account, and returns the sweep record that tracks it. Only one sweep per bank account can be started at a time, and the company's subscription sets how often a sweep may run.

POST
https://api.portal.magicdoor.com/company-app/bank-accounts/{bankAccountId}/sweeps

Authorization

Authorizationstringrequired
Bearer token — Send your API token in the Authorization header as Bearer <token>. Requests without a valid token are rejected with 401 Unauthorized.

Path parameters

bankAccountIdstringrequired

The bank account to sweep the balance into. A Snowflake id sent as a decimal string.

example: 1801556677120004096

Response

200 · The sweep that was started. It begins in a `pending` state and settles asynchronously; poll the sweep endpoints for its progress.

idstring

The sweep record held by MagicDoor. A Snowflake id sent as a decimal string.

bankAccountIdstring

The bank account the sweep moves money for. Absent when the sweep has not been matched to one.

amountnumber

How much the sweep moves, in dollars and cents. Always positive; type says which way it goes.

typeenum<string>

deposit moves money out of the provider's ledger and into the bank account. withdraw takes money from the bank account into the ledger.

depositwithdraw
sweepStatusenum<string>

Where the sweep is in the provider's lifecycle, mirrored from Plaid.

pendingpostedsettledfundsAvailablereturnedfailed
postedstring · date-time

When the provider posted the sweep, in the company's timezone. Absent until then.

settledstring · date-time

When the sweep settled, in the company's timezone. Absent until then.

fundsAvailablestring · date-time

When the money became available, in the company's timezone. Absent until then.

failedstring · date-time

When the sweep failed, in the company's timezone. Absent unless it failed.

returnedstring · date-time

When the sweep was returned, in the company's timezone. Absent unless it was returned.

returnCodestring

The ACH return code the provider reported. Absent unless the sweep was returned.

failureReasonstring

Why the sweep failed, as reported by the provider. Absent unless it failed.

plaidSweepIdstring

Plaid's own id for the sweep. An opaque provider token — do not parse it.

plaidOriginatorIdstring

Plaid's id for the originator the sweep runs under. An opaque provider token.

plaidLedgerIdstring

Plaid's id for the ledger the money moves through. An opaque provider token.

plaidAccountIdstring

Plaid's id for the funding account. An opaque provider token.

lastSyncedstring · date-time

When MagicDoor last refreshed this record from the provider, in the company's timezone. Absent when it has never been refreshed.

createdstring · date-time

When the sweep record was created, in the company's timezone.

401 · The access token is missing, expired, or does not belong to a property manager.

404 · No bank account with that id exists for the caller's company. One belonging to another company reads the same way.

422 · The provider's ledger has nothing available to sweep — its available balance is zero or negative.