list-bank-accounts
Method: GET
Path: /customers/{customer_id}/bank-accounts
Tags: Customers
Summary
List all bank accounts
Description
Retrieve all bank accounts for a customer. Returns an array of CustomerBankAccount objects. Optionally filter by account_type.
Storefront SDK Usage
SDK Method: sdk.customer.listBankAccounts()
Example:
typescript
// Uses customer_id from active session
const { data, error } = await sdk.customer.listBankAccounts();
// Filter by account type
const { data: inbound } = await sdk.customer.listBankAccounts({
account_type: "inbound"
});
// With explicit customer_id and filter
const { data: outbound } = await sdk.customer.listBankAccounts(
{ customer_id: "customer_123" },
{ account_type: "outbound" }
);
if (error) {
console.error("Failed to list bank accounts:", error);
return;
}
console.log("Bank accounts:", data.bank_accounts);TypeScript Definition
typescript
"list-bank-accounts": {
parameters: {
query?: {
/** @description Filter bank accounts by type. */
account_type?: "inbound" | "outbound";
};
header?: never;
path: {
/** @description Customer id */
customer_id: string;
};
cookie?: never;
};
requestBody?: never;
responses: {
/** @description OK */
200: {
headers: {
[name: string]: unknown;
};
content: {
"application/json": {
message?: string;
success?: boolean;
content?: {
bank_accounts?: components["schemas"]["CustomerBankAccount"][];
};
};
};
};
401: components["responses"]["Unauthorized"];
404: components["responses"]["NotFound"];
};
};Component References
| Reference | Resolves To |
|---|---|
components["schemas"]["CustomerBankAccount"] | CustomerBankAccount |
components["responses"]["Unauthorized"] | Unauthorized |
components["responses"]["NotFound"] | NotFound |
Parameters
- account_type (query): Filter bank accounts by type.
Responses
200
OK
401
Not authorized for given operation on the Resource
404
Requested resource not found
OpenAPI Definition
json
{
"tags": [
"Customers"
],
"operationId": "list-bank-accounts",
"summary": "List all bank accounts",
"description": "Retrieve all bank accounts for a customer. Returns an array of `CustomerBankAccount` objects. Optionally filter by `account_type`.",
"externalDocs": {
"url": "https://llm-docs.commercengine.io/storefront/operations/list-bank-accounts",
"description": "API reference for the list-bank-accounts operation"
},
"parameters": [
{
"name": "account_type",
"in": "query",
"description": "Filter bank accounts by type.",
"required": false,
"schema": {
"type": "string",
"enum": [
"inbound",
"outbound"
]
}
}
],
"responses": {
"200": {
"description": "OK",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"message": {
"type": "string"
},
"success": {
"type": "boolean"
},
"content": {
"properties": {
"bank_accounts": {
"type": "array",
"items": {
"$ref": "#/components/schemas/CustomerBankAccount"
}
}
},
"type": "object"
}
}
}
}
}
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"404": {
"$ref": "#/components/responses/NotFound"
}
},
"security": [
{
"Authorization": []
}
],
"x-speakeasy-group": "customers",
"x-speakeasy-ignore": false,
"x-speakeasy-name-override": "listBankAccounts"
}Auto-generated from OpenAPI spec and TypeScript definitions