Browse developer docs

Read farm entitlements

POSTfarm-benefit-info

Request

Send POST to /open/service with serviceName=farm-benefit-info and the common signing parameters.

Send extra fields in the JSON body

Use this to inspect benefits associated with the farm account.

Request example
# Requires curl 7.87+, Python 3 and OpenSSL.
: "${XAG_APP_UID:?Set XAG_APP_UID}"
: "${XAG_APP_SECRET:?Set XAG_APP_SECRET}"
timestamp=$(python3 -c 'import time; print(time.time_ns() // 1000000)')
token=$(printf "%s" "$XAG_APP_UID$timestamp$XAG_APP_SECRET" | openssl dgst -sha1 -r | cut -d " " -f 1)

curl --silent --show-error --fail-with-body --max-time 30 --request POST \
  'https://open.xa.com/open/service' \
  --url-query 'serviceName=farm-benefit-info' \
  --url-query "appUid=$XAG_APP_UID" \
  --url-query "timestamp=$timestamp" \
  --url-query "token=$token" \
  --header 'Content-Type: application/json' \
  --data '{
  "org_id": "YOUR_FARM_ID"
}'
ParameterRequirementMeaning
org_idRequiredAuthorized farm or organization ID.

Response

The farm-level benefits record can be used to show the account’s available entitlements.

Show example response fields and types
{
  "data": {
    "serial_number": "string",
    "relation_owner": "string",
    "name": "string",
    "start_time": "number",
    "end_time": "number",
    "is_expire": "boolean",
    "type": "number",
    "number": "number",
    "used": "number",
    "remain": "number",
    "unit": "string"
  },
  "message": "string",
  "status": "number"
}

All Smart Farm operations

Location
Richmond Hill, Ontario, Canada