get_sales
Retrieve sales records from Simplicate business data to access transaction history, monitor revenue streams, and analyze customer purchases.
Instructions
Retrieve sales records
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | ||
| offset | No |
Input Schema (JSON Schema)
{
"properties": {
"limit": {
"type": "number"
},
"offset": {
"type": "number"
}
},
"type": "object"
}
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; }