Plaid Ledger
API reference for Plaid Ledger
For how-to guidance, see the Ledger documentation.
| Plaid Ledger | |
|---|---|
/transfer/ledger/deposit | Deposit funds into a ledger balance held with Plaid |
/transfer/ledger/distribute | Move available balance between platform and its originator |
/transfer/ledger/get | Retrieve information about the ledger balance held with Plaid |
/transfer/ledger/withdraw | Withdraw funds from a ledger balance held with Plaid |
/transfer/ledger/event/list | Retrieve a list of ledger balance events |
/transfer/ledger/deposit
Deposit funds into a Plaid Ledger balance
Use the /transfer/ledger/deposit endpoint to deposit funds into Plaid Ledger.
Request fields
client_idclient_id. The client_id is required and may be provided either in the PLAID-CLIENT-ID header or as part of a request body.secretsecret. The secret is required and may be provided either in the PLAID-SECRET header or as part of a request body.originator_client_idfunding_account_idfunding_account_ids in the Accounts page of the Plaid Dashboard, under the "Account ID" column. If this field is left blank, the funding account associated with the specified Ledger will be used. If an originator_client_id is specified, the funding_account_id must belong to the specified originator.ledger_idledger_ids in the Accounts page of your Plaid Dashboard. If this field is left blank, this will default to id of the default ledger balance.amountdescription10 idempotency_keyThe API supports idempotency for safely retrying the request without accidentally performing the same operation twice. For example, if a request to create a ledger deposit fails due to a network connection error, you can retry the request with the same idempotency key to guarantee that only a single deposit is created.
50 networkFor requests submitted as either
ach or same-day-ach the cutoff for Same Day ACH is 3:30 PM Eastern Time and the cutoff for Standard ACH transfers is 8:30 PM Eastern Time. It is recommended to submit a request at least 15 minutes before the cutoff time in order to ensure that it will be processed before the cutoff. Any request that is indicated as same-day-ach and that misses the Same Day ACH cutoff, but is submitted in time for the Standard ACH cutoff, will be sent over Standard ACH rails and will not incur same-day charges.ach, same-day-achconst request: TransferLedgerDepositRequest = {
amount: '12.34',
network: 'ach',
idempotency_key: 'test_deposit_abc',
description: 'deposit',
};
try {
const response = await client.transferLedgerDeposit(request);
const sweep = response.data.sweep;
} catch (error) {
// handle error
}
Response fields
sweepA sweep is associated with many sweep events (events of type
swept or return_swept) which can be retrieved by invoking the /transfer/event/list endpoint with the corresponding sweep_id.swept events occur when the transfer amount is credited or debited from your sweep account, depending on the type of the transfer. return_swept events occur when a transfer is returned and Plaid undoes the credit or debit.The total sum of the
swept and return_swept events is equal to the amount of the sweep Plaid creates and matches the amount of the entry on your sweep account ledger.idfunding_account_idledger_idcreateddate-time amountIf amount is not present, the sweep was net-settled to zero and outstanding debits and credits between the sweep account and Plaid are balanced.
iso_currency_codesettleddate expected_funds _available_datedate status"pending" - The sweep is currently pending
"posted" - The sweep has been posted
"settled" - The sweep has settled. This is the terminal state of a successful credit sweep.
"returned" - The sweep has been returned. This is the terminal state of a returned sweep. Returns of a sweep are extremely rare, since sweeps are money movement between your own bank account and your own Ledger.
"funds_available" - Funds from the sweep have been released from hold and applied to the ledger's available balance. (Only applicable to deposits.) This is the terminal state of a successful deposit sweep.
"failed" - The sweep has failed. This is the terminal state of a failed sweep.pending, posted, settled, funds_available, returned, failed, nulltrigger"manual" - The sweep is created manually by the customer
"incoming" - The sweep is created by incoming funds flow (e.g. Incoming Wire)
"balance_threshold" - The sweep is created by balance threshold setting
"automatic_aggregate" - The sweep is created by the Plaid automatic aggregation process. These funds did not pass through the Plaid Ledger balance.manual, incoming, balance_threshold, automatic_aggregatedescriptionnetwork_trace_idFor
ach or same-day-ach transfers, this is the ACH trace number.
For rtp transfers, this is the Transaction Identification number.
For wire transfers, this is the IMAD (Input Message Accountability Data) number.failure_reason"failed" or "returned". Null value otherwise.failure_codeR01. A failure code will be provided if and only if the sweep status is returned. See ACH return codes for a full listing of ACH return codes and RTP/RfP error codes for RTP error codes.descriptionrequest_id{
"sweep": {
"id": "8c2fda9a-aa2f-4735-a00f-f4e0d2d2faee",
"funding_account_id": "8945fedc-e703-463d-86b1-dc0607b55460",
"ledger_id": "563db5f8-4c95-4e17-8c3e-cb988fb9cf1a",
"created": "2020-08-06T17:27:15Z",
"amount": "-12.34",
"iso_currency_code": "USD",
"settled": null,
"status": "pending",
"trigger": "manual",
"description": "deposit",
"network_trace_id": null
},
"request_id": "saKrIBuEB9qJZno"
}/transfer/ledger/distribute
Move available balance between ledgers
Use the /transfer/ledger/distribute endpoint to move available balance between ledgers, if you have multiple. If you’re a platform, you can move funds between one of your ledgers and one of your customer’s ledger.
Request fields
client_idclient_id. The client_id is required and may be provided either in the PLAID-CLIENT-ID header or as part of a request body.secretsecret. The secret is required and may be provided either in the PLAID-SECRET header or as part of a request body.from_ledger_idto_ledger_idamountidempotency_keyThe API supports idempotency for safely retrying the request without accidentally performing the same operation twice. For example, if a request to create a ledger distribute fails due to a network connection error, you can retry the request with the same idempotency key to guarantee that only a single distribute is created.
50 descriptionconst request: TransferLedgerDistributeRequest = {
from_client_id: '6a65dh3d1h0d1027121ak184',
to_client_id: '415ab64b87ec47401d000002',
amount: '12.34',
idempotency_key: 'test_distribute_abc',
description: 'distribute',
};
try {
const response = await client.transferLedgerDistribute(request);
} catch (error) {
// handle error
}
Response fields
request_id{
"request_id": "saKrIBuEB9qJZno"
}/transfer/ledger/get
Retrieve Plaid Ledger balance
Use the /transfer/ledger/get endpoint to view a balance on the ledger held with Plaid.
Request fields
client_idclient_id. The client_id is required and may be provided either in the PLAID-CLIENT-ID header or as part of a request body.secretsecret. The secret is required and may be provided either in the PLAID-SECRET header or as part of a request body.ledger_idledger_ids in the Accounts page of your Plaid Dashboard. If this field is left blank, this will default to id of the default ledger balance.originator_client_idtry {
const response = await client.transferLedgerGet({});
const available_balance = response.data.balance.available;
const pending_balance = response.data.balance.pending;
} catch (error) {
// handle error
}
Response fields
ledger_idbalancenameis_defaultrequest_id{
"ledger_id": "563db5f8-4c95-4e17-8c3e-cb988fb9cf1a",
"name": "Default",
"is_default": true,
"balance": {
"available": "1721.70",
"pending": "123.45"
},
"request_id": "saKrIBuEB9qJZno"
}/transfer/ledger/withdraw
Withdraw funds from a Plaid Ledger balance
Use the /transfer/ledger/withdraw endpoint to withdraw funds from a Plaid Ledger balance.
Request fields
client_idclient_id. The client_id is required and may be provided either in the PLAID-CLIENT-ID header or as part of a request body.secretsecret. The secret is required and may be provided either in the PLAID-SECRET header or as part of a request body.originator_client_idfunding_account_idfunding_account_ids in the Accounts page of the Plaid Dashboard, under the "Account ID" column. If this field is left blank, the funding account associated with the specified Ledger will be used. If an originator_client_id is specified, the funding_account_id must belong to the specified originator.ledger_idledger_ids in the Accounts page of your Plaid Dashboard. If this field is left blank, this will default to id of the default ledger balance.amountdescription10 idempotency_keyThe API supports idempotency for safely retrying the request without accidentally performing the same operation twice. For example, if a request to create a ledger withdraw fails due to a network connection error, you can retry the request with the same idempotency key to guarantee that only a single withdraw is created.
50 networkFor transfers submitted as
ach or same-day-ach, the Standard ACH cutoff is 8:30 PM Eastern Time.For transfers submitted as
same-day-ach, the Same Day ACH cutoff is 3:30 PM Eastern Time. It is recommended to send the request 15 minutes prior to the cutoff to ensure that it will be processed in time for submission before the cutoff. If the transfer is processed after this cutoff but before the Standard ACH cutoff, it will be sent over Standard ACH rails and will not incur same-day charges; this will apply to both legs of the transfer if applicable. The transaction limit for a Same Day ACH transfer is $1,000,000. Authorization requests sent with an amount greater than $1,000,000 will fail.For transfers submitted as
rtp, Plaid will automatically route between Real Time Payment rail by TCH or FedNow rails as necessary. If a transfer is submitted as rtp and the counterparty account is not eligible for RTP, the /transfer/authorization/create request will fail with an INVALID_FIELD error code. To pre-check to determine whether a counterparty account can support RTP, call /transfer/capabilities/get before calling /transfer/authorization/create.Wire transfers are currently in early availability. To request access to
wire as a payment network, contact your Account Manager. For transfers submitted as wire, the type must be credit; wire debits are not supported. The cutoff to submit a wire payment is 6:30 PM Eastern Time on a business day; wires submitted after that time will be processed on the next business day. The transaction limit for a wire is $999,999.99. Authorization requests sent with an amount greater than $999,999.99 will fail.ach, same-day-ach, rtp, wireconst request: TransferLedgerWithdrawRequest = {
amount: '12.34',
network: 'ach',
idempotency_key: 'test_deposit_abc',
description: 'withdraw',
};
try {
const response = await client.transferLedgerWithdraw(request);
const sweep = response.data.sweep;
} catch (error) {
// handle error
}
Response fields
sweepA sweep is associated with many sweep events (events of type
swept or return_swept) which can be retrieved by invoking the /transfer/event/list endpoint with the corresponding sweep_id.swept events occur when the transfer amount is credited or debited from your sweep account, depending on the type of the transfer. return_swept events occur when a transfer is returned and Plaid undoes the credit or debit.The total sum of the
swept and return_swept events is equal to the amount of the sweep Plaid creates and matches the amount of the entry on your sweep account ledger.idfunding_account_idledger_idcreateddate-time amountIf amount is not present, the sweep was net-settled to zero and outstanding debits and credits between the sweep account and Plaid are balanced.
iso_currency_codesettleddate expected_funds _available_datedate status"pending" - The sweep is currently pending
"posted" - The sweep has been posted
"settled" - The sweep has settled. This is the terminal state of a successful credit sweep.
"returned" - The sweep has been returned. This is the terminal state of a returned sweep. Returns of a sweep are extremely rare, since sweeps are money movement between your own bank account and your own Ledger.
"funds_available" - Funds from the sweep have been released from hold and applied to the ledger's available balance. (Only applicable to deposits.) This is the terminal state of a successful deposit sweep.
"failed" - The sweep has failed. This is the terminal state of a failed sweep.pending, posted, settled, funds_available, returned, failed, nulltrigger"manual" - The sweep is created manually by the customer
"incoming" - The sweep is created by incoming funds flow (e.g. Incoming Wire)
"balance_threshold" - The sweep is created by balance threshold setting
"automatic_aggregate" - The sweep is created by the Plaid automatic aggregation process. These funds did not pass through the Plaid Ledger balance.manual, incoming, balance_threshold, automatic_aggregatedescriptionnetwork_trace_idFor
ach or same-day-ach transfers, this is the ACH trace number.
For rtp transfers, this is the Transaction Identification number.
For wire transfers, this is the IMAD (Input Message Accountability Data) number.failure_reason"failed" or "returned". Null value otherwise.failure_codeR01. A failure code will be provided if and only if the sweep status is returned. See ACH return codes for a full listing of ACH return codes and RTP/RfP error codes for RTP error codes.descriptionrequest_id{
"sweep": {
"id": "8c2fda9a-aa2f-4735-a00f-f4e0d2d2faee",
"funding_account_id": "8945fedc-e703-463d-86b1-dc0607b55460",
"ledger_id": "563db5f8-4c95-4e17-8c3e-cb988fb9cf1a",
"created": "2020-08-06T17:27:15Z",
"amount": "12.34",
"iso_currency_code": "USD",
"settled": null,
"status": "pending",
"trigger": "manual",
"description": "withdraw",
"network_trace_id": null
},
"request_id": "saKrIBuEB9qJZno"
}/transfer/ledger/event/list
List transfer ledger events
Use the /transfer/ledger/event/list endpoint to get a list of ledger events for a specific ledger based on specified filter criteria.
Request fields
client_idclient_id. The client_id is required and may be provided either in the PLAID-CLIENT-ID header or as part of a request body.originator_client_idsecretsecret. The secret is required and may be provided either in the PLAID-SECRET header or as part of a request body.start_datedate-time end_datedate-time ledger_idledger_event_idsource_type"TRANSFER" - The source of the ledger event is a transfer
"SWEEP" - The source of the ledger event is a sweep
"REFUND" - The source of the ledger event is a refundTRANSFER, SWEEP, REFUNDsource_idcountcount, the most recent events will be returned.25 25 1 offsetcount=25 and offset=0, the first 25 events will be returned. When count=25 and offset=25, the next 25 events will be returned.0 0 const request: TransferLedgerEventListRequest = {
originator_client_id: "8945fedc-e703-463d-86b1-dc0607b55460",
start_date: '2019-12-06T22:35:49Z',
end_date: '2019-12-12T22:35:49Z',
count: 14,
offset: 2,
ledger_id: "563db5f8-4c95-4e17-8c3e-cb988fb9cf1a",
ledger_event_id: "3gE5gnRzNyfXpBK5wEEKcymJ5albGVUqg77gr",
source_type: "transfer",
source_id: "460cbe92-2dcc-8eae-5ad6-b37d0ec90fd9",
};
try {
const response = await plaidClient.transferLedgerEventList(request);
const events = response.data.ledger_events;
for (const event of events) {
// iterate through events
}
} catch (error) {
// handle error
}
Response fields
ledger_eventsledger_event_idledger_idamounttransfer_idrefund_idsweep_iddescriptionpending_balanceavailable_balancetypetimestampdate-time has_morerequest_id{
"ledger_events": [
{
"ledger_event_id": "3gE5gnRzNyfXpBK5wEEKcymJ5albGVUqg77gr",
"ledger_id": "563db5f8-4c95-4e17-8c3e-cb988fb9cf1a",
"amount": "100.00",
"type": "deposit",
"transfer_id": "460cbe92-2dcc-8eae",
"description": "Converted to available",
"pending_balance": "100.00",
"available_balance": "100.00",
"timestamp": "2023-12-01T10:00:00Z"
}
],
"has_more": false,
"request_id": "mdqfuVxeoza6mhu"
}