A minimal React app demonstrating how to integrate with the Zoho Inventory REST API — covering OAuth2 token refresh, items, sales orders, invoices, contacts, and organizations.
| Resource | Operations |
|---|---|
| Auth | Refresh OAuth2 access token via refresh token |
| Items | Get items, Create item |
| Sales Orders | Get orders, Create order |
| Invoices | Get invoices, Create invoice, Mark as sent |
| Contacts | Get contacts, Create contact, Send email statement |
| Organizations | Get organizations |
sequenceDiagram
participant App as React App
participant Zoho as Zoho Accounts API
participant Inv as Zoho Inventory API
App->>Zoho: POST /oauth/v2/token (refresh_token)
Zoho->>App: access_token
App->>Inv: GET /items (Authorization: Zoho-oauthtoken ...)
Inv->>App: { items: [...] }
App->>Inv: POST /salesorders
Inv->>App: { salesorder: {...} }
In your Zoho API Console:
- Create a Self Client
- Scope:
ZohoInventory.FullAccess.all - Generate a refresh token
cp .env.example .env
# Fill in your credentialsREACT_APP_CLIENT_ID=your_client_id
REACT_APP_CLIENT_SECRET=your_client_secret
REACT_APP_ORGANIZATION_ID=your_org_id
REACT_APP_REFRESH_TOKEN=your_refresh_tokennpm install
npm startNote: The app uses cors-anywhere as a CORS proxy for local development. Visit that link and click "Request temporary access" before using the app.
src/
└── App.js # All Zoho API calls — items, orders, invoices, contacts
- Do not expose
client_secretorrefresh_tokenin a production frontend — proxy requests through a backend server instead - Replace
cors-anywherewith your own CORS proxy or a backend API route - Zoho India endpoint (
zoho.in) — change tozoho.com/zoho.eufor other regions
MIT