Items (one user's login at one institution): status, webhook URL, and removal.

Functions

get-item

fn (access-token: Str): Map
fn (access-token: Str, opts: Map): Map

POST /item/get: the Item's institution, products, consent expiry, webhook and error (e.g. ITEM_LOGIN_REQUIRED when the user must re-authenticate through Link update mode). Returns {item, status, request_id}.

Example

access-token ::hot::ctx/get("plaid.access-token")
out ::plaid::items/get-item(access-token)
out.item.institution_id

remove-item

fn (access-token: Str): Map
fn (access-token: Str, options: Map): Map
fn (access-token: Str, options: Map, opts: Map): Map

POST /item/remove: invalidate the access token and stop billing for the Item. Irreversible. Options: reason_code (e.g. "USER_REQUEST", "FRAUD_FIRST_PARTY"), reason_note.

Example

access-token ::hot::ctx/get("plaid.access-token")
::plaid::items/remove-item(access-token, {reason_code: "USER_REQUEST"})

update-item-webhook

fn (access-token: Str, webhook: Str): Map
fn (access-token: Str, webhook: Str, opts: Map): Map

POST /item/webhook/update: point the Item's webhooks at a new URL (Plaid then sends WEBHOOK_UPDATE_ACKNOWLEDGED). Returns {item, request_id}.

Example

access-token ::hot::ctx/get("plaid.access-token")
::plaid::items/update-item-webhook(access-token, "https://example.com/plaid/webhook")