Queued create of a stock item on the farmer Inventory screen (INVENTORY_PRODUCT POST via InventoryProductWorker); depends on the farmer create. InventoryProductPostRH saves the inventory (if new), the inventory id and supervisor actor id, and the product id. Failures retry.
Headers
Header
Value
Notes
X-SESSIONID
<session token>
Stamped when the operation is queued (dooWithRetry) and re-set by CoreAPI at send time; refreshed on 401.
X-REQUESTID
<uuid v4>
Idempotency key generated by OperationManagerImpl.createOperation for POST/PUT/PATCH when the op enters the offline queue.
X-ACK-REQUESTID
<X-REQUESTID of an earlier completed op>
Added by SyncQueueProcessor for POST/PUT/PATCH: acknowledges a request id the device already saw succeed.
Saved to the inventory table if no inventory exists for the farmer alias; inventory id and actorId written to the product row.
Errors
Status
When
What the app does
401
Session token expired or invalid
CoreAPI invalidates the session id and retries once immediately; if still failing the op stays in the queue (TryAgain.LATER).
500
Server error on a /gateway URL
BaseResponseHandler fetches a new session id (first 5 attempts) and returns TryAgain.LATER; retried per RetryScheduler policy (retry threshold/delay come from app config).
503
Service unavailable
CoreAPI retries once immediately, then the op is retried later by the sync queue.
any non-2xx
Any other failure
Handler onError -> TryAgain.LATER (op stays queued and is visible in Pending Sync); a row is written to the local error_log table (Sync Error Log screen) with URL, body, headers and raw response; every 10th attempt the op is mirrored to Firestore for support.