Creates a land, leased-land or livestock asset that the cadre added on the Land or Livestock screens. The save writes farmerassets plus a FARMER_ASSETS POST sync-ledger entry. FarmerAssetsWorker resolves owningEntityId from the farmer's app id (replacePlatformValues), builds FarmerAssets.post() and queues it with dooWithRetry. The row is marked IN_SYNC_QUEUE. On 2xx, FarmerAssetsPostRH parses the plain-integer body as the new asset id, sets the row to SYNC_DONE and clears ledger dependencies (for example the geofence upload). On error it returns TryAgain.LATER. If the raw response contains "Integrity" and the quantity is null, it sets totalQuantity.value=0.0 and rewrites the queued operation.
Headers
Header
Value
Notes
X-SESSIONID
<session id>
Stamped by CoreAPI when the queued operation runs (CoreAPIDefaultImpl.doOperation). On a 401 the token is invalidated and the call retried. BaseResponseHandler also refreshes the session after a 500 on a gateway URL (first 5 attempts).
X-REQUESTID
<uuid v4>
Idempotency key added by the offline queue (OperationManagerImpl). A 409 replaces it with a new UUID. It is removed for multipart requests.
Values from the asset ref data (land or livestock picker on the Land and Livestock screens).
*.labels[]
array
No
Localised labels, stored in asset_*_labels tables.
totalQuantity.value
double
Yes
Land extent (acres) or head count, from the Extent field. On an "Integrity" error, the RH sets a null value to 0.0 and re-queues.
totalQuantity.uoM
object
No
Unit of measure (code, symbol, measurementType).
nameList[].text
string
No
Asset name or survey label. PII: may contain survey or land identifiers.
assetSpecsList[]
array
No
specName/specValue pairs (for example survey number). PII: land record identifiers.
appMillMetadata.ie_appId
string
No
Local app id of the farmer, used to resolve owningEntityId offline.
assetCheckSum
string
No
MD5 of the asset name plus total quantity (IeAsset.setMD5Hash). The server uses it to detect checksum mismatches (ERR_PLATFORM_ASSET_CHECKSUM_MISMATCH).
Local-only Room columns that Moshi/Gson also serialise. The server is not known to read them.
Response
Example response body (synthetic data)
5501
Field
Type
Required
Notes
(body)
int (plain text)
New server asset id. Saved only if rawResponse.toIntOrNull() is not null; otherwise the success is silently ignored.
Errors
Status
When
What the app does
401
Session expired
CoreAPI invalidates the session id and retries once. If it still fails, the response handler returns TryAgain.LATER and the operation stays in the queue.
409
Duplicate X-REQUESTID
SyncQueueProcessor records the request id and swaps in a fresh X-REQUESTID for the next attempt.
4xx/5xx (other)
Server rejects or fails
onError returns TryAgain.LATER (FarmerAssetsPostRH). Each failure is logged in the local error_log table (URL, body, headers). Every 10th attempt (up to attempt 5000) the whole operation is copied to Firestore urvi_sync_log. A 500 on a gateway URL in the first 5 attempts forces a session refresh.