---
title: "Sync Order History"
method: POST
path: "/api/orders/sync-history"
tags: ["Orders"]
---

# Sync Order History

`POST /api/orders/sync-history`

## Request

- Base URL: `https://api.soeru.biz` (the document declares no server; this is the origin it was published from)
- URL: `https://api.soeru.biz/api/orders/sync-history`
- Auth: none declared. Required headers: `authorization`

Sync historical orders to build order_history table.

Fetches all orders from the past N months and saves them to the
order_history table for accurate repeat-customer counting.
Uses platform-specific maximum periods when months_back is 0 or omitted.

## Headers

- `x-shop-id` string, nullable: Optional shop ID
- `authorization` string, required: Bearer <token>

## Request body

- SyncHistoryRequest
  - `months_back` integer

## Response `200`

Successful Response

- unknown

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/soeru/apis/soeru-api.md) · [All operations](https://skmtc.dev/soeru/apis/soeru-api/llms.txt) · [OpenAPI document](https://skmtc.dev/soeru/apis/soeru-api/revisions/63f8d371abed?raw)
