# List expenses Building with an AI agent? Start at https://docs.payme.io/agents.md - Sandbox: your partner domain on the Keep sandbox: `GET https://.keep.co.il/api/public/expenses` - Production: your partner domain: `GET https://.keep.co.il/api/public/expenses` ## Credentials - Header `Authorization: Bearer ` Retrieve expense records for a seller with optional date filtering and pagination. **Seller identification:** Same rules as the upload endpoint — provide `sellerId` alone, or `socialId` + `email`. **Date filtering:** `valueDateStart` and `valueDateEnd` filter on the expense value date (not creation date). Dates must be ISO format (`YYYY-MM-DD`) and `valueDateStart` must be ≤ `valueDateEnd`. **Pagination:** Defaults to `page=0`, `limit=10`. Maximum `limit=500`. Order of returned items is not guaranteed. ## Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `sellerId` | query | string | no | Seller UUID (use this OR socialId + email) | | `socialId` | query | integer | no | Seller ID number, digits only, sent as a number (must be paired with email). | | `email` | query | string | no | Seller email address (must be paired with socialId) | | `valueDateStart` | query | string | no | Filter expenses from this value date (inclusive, YYYY-MM-DD) | | `valueDateEnd` | query | string | no | Filter expenses up to this value date (inclusive, YYYY-MM-DD) | | `page` | query | integer | no | Page number (zero-based). Minimum 0, default 0. | | `limit` | query | integer | no | Items per page. Positive number, at most 500; use a whole-number item count. Default 10. | ## Code samples ### curl ```bash curl -X GET 'https://.keep.co.il/api/public/expenses' \ -H 'Authorization: Bearer ' ``` ### Node.js ```javascript const response = await fetch("https://.keep.co.il/api/public/expenses", { method: "GET", headers: { "Authorization": "Bearer ", }, }); console.log(await response.text()); ``` ### Python ```python import requests response = requests.get( "https://.keep.co.il/api/public/expenses", headers={ "Authorization": "Bearer ", }, ) print(response.text) ``` ### PHP ```php .keep.co.il/api/public/expenses'); curl_setopt_array($ch, [ CURLOPT_CUSTOMREQUEST => 'GET', CURLOPT_RETURNTRANSFER => true, CURLOPT_HTTPHEADER => [ 'Authorization: Bearer ', ], ]); $response = curl_exec($ch); curl_close($ch); echo $response; ``` ## Responses ### 200 — Expenses retrieved successfully (success) | Field | Type | Description | | --- | --- | --- | | `payload` | object | | | `payload.total` | integer | Total number of matching expenses | | `payload.page` | integer | Current page number | | `payload.limit` | integer | Items per page | | `payload.items` | array | | | `payload.items[].id` | string | Expense record UUID | | `payload.items[].capturedDate` | string | Timestamp when the expense was captured | | `payload.items[].valueDate` | string | Expense value date | | `payload.items[].sellerId` | string | Seller UUID | | `payload.items[].totalAmount` | number | Total expense amount | | `payload.items[].vatAmount` | number | VAT amount | | `payload.items[].currency` | string | Currency code | | `payload.items[].bookkeeperRevisionStatus` | string | Bookkeeper revision status | | `payload.items[].docRegulationId` | string | Document regulation ID | | `payload.items[].docType` | string | Document type | ```json { "payload": { "total": 1, "page": 0, "limit": 10, "items": [ { "id": "50c6b740-874a-4f54-9669-9a60024be4ed", "capturedDate": "2024-06-20T09:35:36.326Z", "valueDate": "2024-06-20T00:00:00.000Z", "sellerId": "a6a9700f-8571-4f9b-bfae-ba943fb96982", "totalAmount": 15200, "vatAmount": 2209, "currency": "ILS", "bookkeeperRevisionStatus": "approved-and-classified", "docRegulationId": "1262", "docType": "invrec" } ] } } ``` ### 400 — Bad Request (error) | Field | Type | Description | | --- | --- | --- | | `statusCode` | integer | HTTP status code | | `message` | string | Error message(s) | | `error` | string | Error type | ```json { "statusCode": 400, "message": [ "Validation failed" ], "error": "Bad Request" } ``` ### 401 — Unauthorized (error) | Field | Type | Description | | --- | --- | --- | | `statusCode` | integer | | | `message` | string | | ```json { "statusCode": 401, "message": "Unauthorized" } ``` ### 403 — The seller does not belong to your partner account. (error) | Field | Type | Description | | --- | --- | --- | | `statusCode` | integer | HTTP status code | | `message` | string | Error message(s) | | `error` | string | Error type | ### 422 — Unprocessable Entity. Message: `Could not resolve seller` — the identifiers match no seller. (error) | Field | Type | Description | | --- | --- | --- | | `statusCode` | integer | HTTP status code | | `message` | string | Error message(s) | | `error` | string | Error type | ```json { "statusCode": 422, "message": "Bad seller configuration. Please contact support!", "error": "Unprocessable Entity" } ```