# Reconciliation

> Base URL: `https://pos.pages.fm/api/v1`. Authenticate with the `api_key` query parameter.

## List of reconciliation sessions

`GET /shops/{SHOP_ID}/reconciliations`

Get list of reconciliation sessions. Each session includes its orders in the `orders` array

### Parameters

| Name | In | Type | Required | Description |
|---|---|---|---|---|
| `SHOP_ID` | path | integer | yes | Shop ID |
| `page` | query | integer |  | Page number |
| `page_size` | query | integer |  | Page size. Default 10, maximum 50 (larger values are clamped to 50) |
| `sort_by` | query | string |  | Sort by `updated_at` ascending (then `system_id`) for incremental sync. If omitted, sessions are sorted by creation time descending Values: `updated_at`. |
| `startDateUpdatedAt` | query | integer (int64) |  | Only sessions with `updated_at` >= this time (unix timestamp in seconds). Can be sent alone without `endDateUpdatedAt` |
| `endDateUpdatedAt` | query | integer (int64) |  | Only sessions with `updated_at` <= this time (unix timestamp in seconds) |
| `include_removed` | query | boolean |  | Include removed sessions (`is_removed: true`). Send `true` to enable |
| `system_id[]` | query | integer[] |  | Filter by internal session ID. Also accepts a single value as `system_id=123` |
| `display_id` | query | integer |  | Filter by session code shown on the shop |
| `search` | query | string |  | Search by `display_id` or `custom_id` of the session. Multiple codes can be separated by space or comma; matches any of them |
| `partner_id[]` | query | string[] |  | Shipping partner ID on Pancake system (see Partner list). Also accepts a single value as `partner_id=1` |
| `creator_id` | query | string (uuid) |  | Filter by creator user ID |
| `order_id` | query | integer |  | Only sessions containing this order (internal order ID, `system_id` of the order) |
| `startDate` | query | integer (int64) |  | Start of the session creation time range (unix timestamp in seconds). Applied only when both `startDate` and `endDate` are sent |
| `endDate` | query | integer (int64) |  | End of the session creation time range (unix timestamp in seconds) |
| `startDatePaidAt` | query | integer (int64) |  | Start of the payment time range (unix timestamp in seconds). Applied only when both `startDatePaidAt` and `endDatePaidAt` are sent; sessions without `paid_at` are excluded |
| `endDatePaidAt` | query | integer (int64) |  | End of the payment time range (unix timestamp in seconds) |

### Responses

- `200` Success (object)
- `403` The API key is invalid or disabled (ErrorResponse)

```json
{
  "success": true,
  "page_number": 1,
  "page_size": 10,
  "total_entries": 1,
  "total_pages": 1,
  "data": [
    {
      "system_id": 123,
      "display_id": 92,
      "custom_id": "7358901234567890123",
      "partner_id": "1",
      "control_type": "control_cod",
      "note": "Đối soát COD tuần 38",
      "excel_cod": 1250000,
      "excel_fee": 65000,
      "pos_cod": 1250000,
      "paid_at": "2026-09-18T08:06:55",
      "payment_status": "paid",
      "creator": {
        "id": "d6e6a545-f102-439e-9943-8ac8369f9735",
        "name": "vudzung12"
      },
      "updater": {
        "id": "d6e6a545-f102-439e-9943-8ac8369f9735",
        "name": "vudzung12"
      },
      "inserted_at": "2026-09-17T03:12:40.512345",
      "updated_at": "2026-09-18T08:06:55.000000",
      "is_removed": false,
      "orders": [
        {
          "order_id": 1418,
          "display_id": 1418,
          "custom_id": null,
          "extend_code": "S58824.MB25.C3.500020713",
          "order_number_vtp": null,
          "order_status": 4,
          "result": "succeed",
          "message": null,
          "cod_amount": 750000,
          "partner_fee": 35000,
          "pos_cod": 750000,
          "currency": "VND",
          "reconciliation_at": "2026-09-17T03:12:40"
        },
        {
          "order_id": 1419,
          "display_id": 1419,
          "custom_id": null,
          "extend_code": "S58824.MB25.C3.500020714",
          "order_number_vtp": null,
          "order_status": 4,
          "result": "mismatch",
          "message": null,
          "cod_amount": 500000,
          "partner_fee": 30000,
          "pos_cod": 520000,
          "currency": "VND",
          "reconciliation_at": "2026-09-17T03:12:40"
        }
      ]
    }
  ]
}
```
