fastify-xplaid
xplaid.items.get
Get the current status and configuration of a Plaid Item, including webhook URL, available products, and consent expiration.
xplaid.items.get
Returns the current status and configuration of a Plaid Item — webhook URL, available products, consent expiration, and update type.
Signature
fastify.xplaid.items.get(
accessToken: string
): Promise<{ item: PlaidItem; status: object | null; requestId: string }>
Params
| Name | Type | Required | Description |
|---|---|---|---|
accessToken | string | Yes | The Item's permanent access token. |
Returns
{ item: PlaidItem; status: object | null; requestId: string }
| Field | Type | Description |
|---|---|---|
item.item_id | string | Stable Plaid Item identifier. |
item.institution_id | string | null | Plaid institution ID for the connected bank. |
item.webhook | string | null | Current webhook URL configured for this Item. |
item.available_products | string[] | Products available but not yet billed. |
item.billed_products | string[] | Products already billed/in use for this Item. |
item.consent_expiration_time | string | null | ISO 8601 timestamp when user consent expires. |
item.update_type | string | Indicates if the item requires background or user-initiated updates. |
status | object | null | Product-level sync status details. |
Throws
[xPlaid] accessToken is required and must be a non-empty string- Plaid API errors — shape:
{ message, statusCode, plaidError }.
Examples
Basic
const { item } = await fastify.xplaid.items.get(accessToken);
console.log(item.webhook); // "https://api.example.com/webhooks/plaid"
console.log(item.available_products); // ["identity", "investments"]
console.log(item.billed_products); // ["transactions", "auth"]
Realistic
fastify.get("/plaid/item-status", async (request, reply) => {
const record = await db.plaidItems.findFirst({ where: { userId: request.user.id } });
if (!record) return reply.status(404).send({ error: "No linked account" });
try {
const { item, status } = await fastify.xplaid.items.get(decrypt(record.accessToken));
return {
itemId: item.item_id,
institutionId: item.institution_id,
webhook: item.webhook,
consentExpires: item.consent_expiration_time,
availableProducts: item.available_products,
status,
};
} catch (error) {
if (error.plaidError) {
return reply.status(error.statusCode ?? 500).send({ error: error.message });
}
throw error;
}
});
See also
- items.remove — Permanently remove an Item and revoke its access token.
- items.getInstitution — Retrieve institution details by Plaid institution ID.
- webhooks.update — Update the webhook URL for an Item after creation.
- link.createToken — Re-link a disconnected Item in update mode using
accessToken.
AI Context
package: "@xenterprises/fastify-xplaid"
method: fastify.xplaid.items.get(accessToken)
use-when: Inspect the status, webhook, products, and consent expiration of a Plaid Item
returns: { item: { item_id, institution_id, webhook, available_products, billed_products, consent_expiration_time, update_type }, status, requestId }
