Asset endpoints allow you to create, delete, retrieve, and share Asset Reports with information about a user's assets and transactions.
Endpoint: '/asset_report/create'
The create ****endpoint initiates the process of creating an Asset Report, which can then be retrieved by passing the asset_report_token return value to the /asset_report/get ****or /asset_report/pdf/get ****endpoints.
The Asset Report takes some time to be created and is not available immediately after calling create. When the Asset Report is ready to be retrieved using /asset_report/get or /asset_report/pdf/get, Plaid will fire a PRODUCT_READY webhook.
The create endpoint creates an Asset Report at a moment in time. Asset Reports are immutable. To get an updated Asset Report, use the refresh endpoint.
Example Request
const daysRequested = 60;
const options = {
client_report_id: '123',
webhook: '<https://www.example.com>',
user: {
client_user_id: '7f57eb3d2a9j6480121fx361',
first_name: 'Jane',
middle_name: 'Leah',
last_name: 'Doe',
ssn: '123-45-6789',
phone_number: '(555) 123-4567',
email: '[email protected]',
},
};
const request: AssetReportCreateRequest = {
access_tokens: [accessToken],
days_requested,
options,
};
// accessTokens is an array of Item access tokens.
// Note that the assets product must be enabled for all Items.
// All fields on the options object are optional.
try {
const response = await plaidClient.assetReportCreate(request);
const assetReportId = response.data.asset_report_id;
const assetReportToken = response.data.asset_report_token;
} catch (error) {
// handle error
}
Example Response:
{
"asset_report_token": "assets-sandbox-6f12f5bb-22dd-4855-b918-f47ec439198a",
"asset_report_id": "1f414183-220c-44f5-b0c8-bc0e6d4053bb",
"request_id": "Iam3b"
}
Endpoint '/asset_report/get'
The get endpoint retrieves the Asset Report in JSON format. Before calling the get endpoint, you must first create the Asset Report using create (or filter an Asset Report using filter) and then wait for the PRODUCT_READY webhook to fire, indicating that the Report is ready to be retrieved.