Sync stock from Tiny
Pulls Tiny's stock into the store's location (matching variants by SKU)
in the background and answers 202 at once; follow it with
getErpProviderHealth (status.last_sync_at, status.last_error).
With dry_run=true it runs inline, writes nothing and answers 200 with
what would change. The scheduled sync (leader-elected worker) is
separate and unaffected.
Authorization
bearer_auth Authorization: Bearer <token>. Either a session access token from POST /auth/login (refresh it with POST /auth/refresh) or a store API token (mobi_st_…). A store API token works only for the store it was issued in, and can do at most what its issuing user can there, narrowed to the scopes it was issued with.
In: header
Path Parameters
Store id
uuidERP provider id
uuidQuery Parameters
Location the ERP's stock is written to; defaults to the store's first active location (created when the store has none).
uuidCompute what the sync would change and answer with it, writing nothing.
Header Parameters
A unique value (e.g. a UUID) per logical request. Retrying with the same key within 24 hours replays the first response instead of repeating the side effect; the replay carries Idempotent-Replayed: true. Reusing a key for a different request is a 422 idempotency_key_reused; retrying while the first is still running is a 409 idempotency_request_in_progress. JSON bodies up to 1 MB.
length <= 255Response Body
application/json
application/json
application/json
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://example.com/stores/497f6eca-6276-4993-bfeb-53cbbbba6f08/erp-providers/497f6eca-6276-4993-bfeb-53cbbbba6f08/tiny/sync"{
"component_count": 0,
"dry_run": true,
"error_count": 0,
"errors": [
{}
],
"kit_count": 0,
"location_id": "46910cc3-ab41-4b80-b4a7-94dab9f1b795",
"skipped_count": 0,
"synced_count": 0,
"total_fetched": 0,
"trigger": "string"
}{
"message": "string",
"started": true
}{
"code": "not_found",
"details": {},
"error": "Order not found"
}{
"code": "not_found",
"details": {},
"error": "Order not found"
}{
"code": "not_found",
"details": {},
"error": "Order not found"
}{
"code": "not_found",
"details": {},
"error": "Order not found"
}{
"code": "not_found",
"details": {},
"error": "Order not found"
}{
"code": "not_found",
"details": {},
"error": "Order not found"
}