Before you start
- A Leaf account with API credentials and a valid token.
- A Leaf user created (see Field Operations Quickstart).
- A John Deere developer account. Register at developer.deere.com if you don’t have one.
Step 1: Create a John Deere application
Sign in to the John Deere developer portal, navigate to My Applications, and click Create Application. Fill in your company information and select the APIs you need:
After creation, note your App ID and Shared Secret. John Deere may take some time to approve API access.
Enable webhook permissions
Leaf uses John Deere webhooks to receive real-time notifications when grower data changes, which means faster data delivery than polling alone. You need to explicitly request webhook access for your application:- In My Applications, select your application and click Request Access.
- Navigate to Precision Tech → Application, open the Operations Center - Webhook menu.
- Check both Webhook Read and Webhook Write.
- Click Submit Request. Approval typically takes a few hours.
Step 2: Get the authorization URL
Redirect the grower to John Deere’s OAuth consent page. Leaf provides a helper endpoint that constructs the URL:clientRedirectUrl with a code parameter in the URL.
Step 3: Exchange the code for tokens
Use the redirect URL (including thecode) to get the user’s tokens:
refreshToken. You’ll attach it to the Leaf user in the next step.
Step 4: Grant organization access
The grower must explicitly share their organizations with your application. Redirect them to:Step 5: Attach credentials to the Leaf user
clientEnvironment to STAGE for sandbox testing or PRODUCTION once John Deere has approved your app for production. Leaf manages token refresh automatically after this point.

