get_sales
Retrieve sales records from Simplicate business data to access transaction history, monitor revenue streams, and analyze customer purchases.
Instructions
Retrieve sales records
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "get_sales"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | ||
| offset | No |
Implementation Reference
- The main handler function for the 'get_sales' tool, which retrieves sales data from the Simplicate '/sales/sale' API endpoint, with optional pagination parameters. Handles errors by returning an empty array.
async getSales(params?: { limit?: number; offset?: number }): Promise<SimplicateSale[]> { try { const response = await this.client.get('/sales/sale', params); return response.data || []; } catch (error) { // Sales endpoint may require specific filters console.warn('getSales: endpoint returned error, returning empty array'); return []; } } - TypeScript interface defining the structure of a SimplicateSale object, used as the return type for the getSales handler.
export interface SimplicateSale { id: string; sale_number: string; subject: string; organization?: { id: string; name: string }; status: string; total: number; }