POS Machine Integration with Zoho Inventory (Zoho Inventory)

POS Machine Integration with Zoho Inventory (Zoho Inventory)

Outcome:

     Expected Outcome for POS Machine Integration with Zoho Inventory  

After successfully integrating Pine Labs POS Machine with Zoho Inventory, the system will achieve the following results:

1️⃣ Seamless Order Processing:

  • When a customer purchases an item at the stall, the POS system will send payment details to Zoho Inventory.

  • The stall operator can enter the customer's name, phone number, and address at checkout.

2️⃣ Automated Payment Capture:

  • Once the payment is successfully processed via Pine Labs POS, the transaction will be recorded in Zoho Inventory.

  • A corresponding Sales Order will be automatically created in Zoho Inventory.

3️⃣ Real-Time Order Status Updates:

  • The order will be marked as paid and then automatically updated to "Delivered" in Zoho Inventory.

  • This ensures that all sales transactions are properly recorded and tracked.

4️⃣ Stock Management from Flea Market Warehouse:

  • The purchased item’s stock will be reduced from the Flea Market Warehouse in Zoho Inventory.

      • This prevents overselling and keeps inventory levels accurate across different POS locations.

5️⃣ Multi-Location POS Synchronization:

  • If multiple POS machines are used across locations, the integration will ensure that each machine syncs with Zoho Inventory in real time.

  • Inventory updates will reflect instantly across all sales points.

6️⃣ Automated Invoice & Payment Confirmation:

  • Customers can receive payment confirmation & invoices via WhatsApp using Zoho’s automation tools.

7️⃣ Improved Business Efficiency:

  • No need for manual data entry, reducing errors and saving time.

  • Business owners get real-time reports on sales, payments, and stock levels.

🚀 Final Impact:  

✔️ Faster checkout & payment processing
✔️ Automated inventory updates & order management
✔️ Accurate stock tracking for better decision-making
✔️ Reduced manual work & improved operational efficiency 

  • Use case Implementation Steps:

Implementation Stage 1: Set Up Zoho Inventory  

     Sign up for Zoho Inventory → Zoho Inventory Signup

     Enable API Access (You’ll need this for automation)

      Set up Warehouses:

  • Go to Settings > Warehouses

  • Add Flea Market Warehouse

 

 

 

 

Implementation Stage 2: Get API Access From Zoho Inventory

  1.  Go to Zoho API ConsoleZoho API Documentation

  2. Generate Client ID & Client Secret

  3. Obtain your Organization ID

  • API Request to Get Org ID:

  1. Save your API credentials for future use.
     

 

 

 

 

Implementation Stage 3: Get Webhook/API Access from Pine Labs  

  1. Contact Pine Labs Support → Request API & Webhook access

  2. Configure Webhook URL in Pine Labs to notify Zoho when a payment is successful.

  3. Sample Pine Labs Webhook Payload:

{

  "transaction_id": "PL123456",

  "amount": 500,

  "status": "Success",

  "customer": {

    "name": "John Doe",

    "phone": "+919876543210"

  },

  "items": [

   {"product_id": "P001", "quantity": 2}

  ]

}

  1. Once the payment is captured in Pine Labs, trigger Zoho API calls to update Inventory.

    

 

Implementation Stage 4: Set Create a Sales Order in Zoho Inventory

📌 Once payment is successful, automatically create a Sales Order in Zoho Inventory.

      API Request to Create Sales Order

POST https://inventory.zoho.com/api/v1/salesorders

 

      Request Body:

{

  "customer_id": "123456",

  "date": "2025-03-30",

  "line_items": [

    {

      "item_id": "P001",

      "quantity": 2,

      "rate": 250

    }

  ],

  "status": "confirmed"

}

      Response: This creates a Sales Order in Zoho Inventory.

 

Implementation Stage 5: Capture Payment & Mark Order as Delivered  

📌 After payment is captured in Pine Labs, update payment status in Zoho Inventory.

     API Request to Capture Payment in Zoho Inventory

POST https://inventory.zoho.com/api/v1/invoices/{invoice_id}/payments

     Request Body:

{

  "amount": 500,

  "payment_mode": "POS Machine",

  "reference_number": "TXN123456"

}

     Response: This marks the order as Paid.

      API Request to Mark Order as Delivered

PUT https://inventory.zoho.com/api/v1/salesorders/{salesorder_id}

     Request Body:

{

  "status": "delivered"

}

     Response: The order status updates to Delivered in Zoho Inventory.

Implementation Stage 3: Set Reduce Stock from Flea Market Warehouse

📌 After marking the order as delivered, update stock levels.

     API Request to Reduce Stock

POST https://inventory.zoho.com/api/v1/items/{item_id}

     Request Body:

{

  "warehouse_id": "Flea_Market_ID",

  "adjustment_type": "reduce",

  "quantity": 2

}

     Response: Stock is updated in the Flea Market Warehouse.

     Final Steps  

     Test API Integration

     Check if Sales Order, Payment, and Stock Update Work Properly

      Go Live Once Everything is Working Smoothly!

  • Target Audience:

🎯 Target Audience for POS Machine Integration with Zoho Inventory  

The POS Machine Integration with Zoho Inventory is designed for businesses that require seamless order processing, automated stock management, and real-time payment tracking. The key target audiences include:

1️⃣ Retail Business Owners

  • Store owners who want to integrate their POS machines with Zoho Inventory for real-time sales tracking and inventory updates.

  • Examples: Supermarkets, grocery stores, apparel stores, electronics shops.

2️⃣ E-commerce & Marketplace Sellers

  • Business owners selling on Amazon, Flipkart, or their own e-commerce website who need to sync their offline (POS) and online inventory.

3️⃣ Flea Market & Exhibition Sellers

  • Vendors operating in pop-up stalls, flea markets, and trade fairs who need to track sales and reduce stock from specific warehouse locations.

4️⃣ Multi-Location Businesses

  • Businesses with multiple retail stores or sales counters that require centralized inventory management across different locations.

5️⃣ Warehouse & Inventory Managers

  • Teams managing product stock and distribution who need to ensure accurate stock levels after every POS transaction.

6️⃣ Finance & Accounts Teams

  • Businesses that want automated payment recording & invoice generation, reducing manual bookkeeping work.

7️⃣ Zoho Inventory & POS System Integrators

  • Developers and consultants helping businesses integrate POS machines with Zoho Inventory using APIs.

🎯 Why This Integration is Beneficial?  

✔️ Automates sales & inventory updates → Saves time and reduces errors.
✔️ Improves customer experience → Faster checkout & seamless order processing.
✔️ Provides real-time data → Business owners can track sales, payments, and stock from anywhere.
✔️ Enables multi-location sync → Ensures smooth operations across different outlets.

 

 

  • Users:

👥 Users for POS Machine Integration with Zoho Inventory  

The integration will be used by different types of users, depending on their roles in the business. Here are the key users:

1️⃣ Stall Operators / Cashiers  

  • Role: Operate the POS machine, select items, process customer payments.

  • How They Use It:

    • Scan/select products from the catalog.

    • Enter customer details (name, phone number, address).

    • Process payments via Pine Labs POS.

    • Ensure the order is marked as "Delivered" after payment.

2️⃣ Business Owners / Store Managers  

  • Role: Oversee sales, inventory, and financial transactions.

  • How They Use It:

    • Monitor real-time sales orders and stock updates.

    • Get automated payment confirmations.

    • Ensure stock is updated correctly in Zoho Inventory.

    • Track multiple POS locations and sales trends.

3️⃣ Inventory Managers  

  • Role: Manage stock levels and warehouse updates.

  • How They Use It:

    • Ensure products are deducted from the Flea Market Warehouse after a sale.

    • Prevent overstocking or stockouts by monitoring real-time inventory.

    • Generate reports on product movement.

4️⃣ Finance & Accounting Teams  

  • Role: Handle invoices, payments, and financial reconciliation.

  • How They Use It:

    • Verify captured payments from POS machines.

    • Automate invoice generation and customer payment confirmations.

    • Reconcile daily sales and update financial records.

5️⃣ IT Teams / Developers  

  • Role: Implement and maintain POS integration with Zoho Inventory.

  • How They Use It:

    • Configure API connections between Pine Labs POS and Zoho Inventory.

    • Set up automated workflows (payment → sales order → stock update).

    • Debug and resolve integration issues.

6️⃣ Customers (Indirect Users)  

  • Role: Buy products and complete transactions via POS.

  • How They Use It:

    • Select items and make payments via Pine Labs POS.

    • Receive digital invoices or WhatsApp payment confirmations.

 

  • Flow Chart:

     Flowchart Breakdown  

1️⃣ Customer selects items from the catalog.
2️⃣ Cashier enters customer details (name, phone, address).
3️⃣ Payment is processed via Pine Labs POS.
4️⃣ If payment is successful, the system:

  • Creates a Sales Order in Zoho Inventory.

  • Records the payment & marks the order as "Delivered."

  • Reduces stock from the Flea Market Warehouse.

  • Sends an invoice & payment confirmation via WhatsApp/Email.
    5️⃣ The transaction is completed and recorded in the system.

 

  • Tool Permission Required:

1. Assign Appropriate User Roles:

  • Administrator Role: Users with the Administrator role inherently have comprehensive access to all modules and settings within Zoho Inventory, including API integrations. If the integration is managed under an Administrator account, no additional permissions are typically required.

  • Custom Roles: For users not designated as Administrators, you'll need to create or modify roles to include API access. Here's how:

    • Access Profiles:

      • Navigate to Settings in Zoho Inventory.

      • Select Users & Roles.

      • Choose Profiles to view existing roles.

    • Modify or Create a Role:

      • To edit an existing role, select it and click Edit.

      • To create a new role, click New Profile and define its permissions.

    • Enable API Access:

      • Within the role settings, ensure that the API Access permission is enabled. This grants the user the ability to interact with Zoho Inventory's API.

    • Assign the Role:

      • Go to the Users section.

      • Assign the configured role to the appropriate user accounts.

2. Configure API Scopes:

When generating OAuth tokens for API access, it's crucial to define the appropriate scopes to specify the level of access. For comprehensive integration tasks, include scopes such as:

  • ZohoInventory.fullaccess.ALL

  • ZohoInventory.settings.ALL

These scopes ensure the integration has the necessary permissions to perform actions like creating sales orders, capturing payments, and updating stock levels.

3. Addressing Permission Errors:

If you encounter a NO_PERMISSION error during API calls, consider the following steps:

  • Verify User Role: Confirm that the user account associated with the API token has the correct role with API access enabled.

  • Check Module Permissions: Ensure that the role has the necessary permissions for specific modules involved in the integration, such as Sales Orders, Invoices, and Items.

  • Review API Scopes: Make sure that the OAuth token includes all required scopes for the intended API operations.

 

  • Link Required:

  • Zoho Inventory API Documentation:

    • Overview: Provides comprehensive details on how to interact with Zoho Inventory programmatically.

    • Access it here:  Zoho

  • Managing Users and Roles in Zoho Inventory:

    • Overview: Learn how to assign roles and set permissions for users within your organization.

    • Access it here: Zoho

  • OAuth Authentication for Zoho Inventory:

    • Overview: Understand the process of authenticating API requests using OAuth, ensuring secure access to your inventory data.

    • Access it here: Zoho

 

Step 1: Set Up API Keys  

Before starting, get:
Pine Labs API Key (from Pine Labs support)
Zoho Inventory API Key (from Zoho Developer Console)

Step 2: Create the API Integration Code  

📌 Install Dependencies

npm init -y

npm install express axios dotenv

 

📌 Create a .env file to store API credentials:

PINE_LABS_API_KEY=your_pinelabs_api_key

ZOHO_INVENTORY_ACCESS_TOKEN=your_zoho_access_token

ZOHO_ORG_ID=your_zoho_org_id

📌 Create index.js for API integration

require("dotenv").config();

const express = require("express");

const axios = require("axios");

 

const app = express();

app.use(express.json());

 

// Pine Labs and Zoho Inventory Credentials

const PINE_LABS_API_KEY = process.env.PINE_LABS_API_KEY;

const ZOHO_ACCESS_TOKEN = process.env.ZOHO_INVENTORY_ACCESS_TOKEN;

const ZOHO_ORG_ID = process.env.ZOHO_ORG_ID;

 

// 📌 Step 1: Capture Payment from Pine Labs

app.post("/capture-payment", async (req, res) => {

  try {

    const { transactionId, amount, customerName, customerPhone, items } = req.body;

 

    // Verify Payment with Pine Labs API

    const paymentResponse = await axios.get(

      `https://api.pinelabs.com/payment/status/${transactionId}`,

      { headers: { Authorization: `Bearer ${PINE_LABS_API_KEY}` } }

    );

 

    if (paymentResponse.data.status !== "Success") {

      return res.status(400).json({ message: "Payment not successful" });

    }

 

    console.log("✅ Payment Captured from Pine Labs");

 

    // 📌 Step 2: Create Sales Order in Zoho Inventory

    const salesOrderResponse = await axios.post(

      "https://www.zohoapis.com/inventory/v1/salesorders",

      {

        customer_name: customerName,

        contact_number: customerPhone,

        line_items: items,

        total: amount,

        status: "confirmed"

      },

      {

        headers: {

          Authorization: `Zoho-oauthtoken ${ZOHO_ACCESS_TOKEN}`,

          "X-com-zoho-inventory-organizationid": ZOHO_ORG_ID

        }

      }

    );

 

    const salesOrderId = salesOrderResponse.data.salesorder.salesorder_id;

    console.log(`✅ Sales Order Created: ${salesOrderId}`);

 

    // 📌 Step 3: Record Payment in Zoho Inventory

    const paymentRecordResponse = await axios.post(

      "https://www.zohoapis.com/inventory/v1/customerpayments",

      {

        payment_mode: "Card",

        amount: amount,

        customer_name: customerName,

        salesorder_id: salesOrderId

      },

      {

        headers: {

          Authorization: `Zoho-oauthtoken ${ZOHO_ACCESS_TOKEN}`,

          "X-com-zoho-inventory-organizationid": ZOHO_ORG_ID

        }

      }

    );

 

    console.log(`✅ Payment Recorded in Zoho Inventory`);

 

    // 📌 Step 4: Mark Order as Delivered

    await axios.post(

      `https://www.zohoapis.com/inventory/v1/salesorders/${salesOrderId}/shipment`,

      { status: "delivered" },

      {

        headers: {

          Authorization: `Zoho-oauthtoken ${ZOHO_ACCESS_TOKEN}`,

          "X-com-zoho-inventory-organizationid": ZOHO_ORG_ID

        }

      }

    );

 

    console.log(`✅ Order Marked as Delivered`);

 

    // 📌 Step 5: Reduce Stock from Flea Market Warehouse

    await axios.post(

      `https://www.zohoapis.com/inventory/v1/adjustments`,

      {

        warehouse_name: "Flea Market Warehouse",

        description: "Stock reduced after sale",

        line_items: items.map((item) => ({

          item_id: item.item_id,

          quantity_adjusted: -item.quantity

        }))

      },

      {

        headers: {

          Authorization: `Zoho-oauthtoken ${ZOHO_ACCESS_TOKEN}`,

          "X-com-zoho-inventory-organizationid": ZOHO_ORG_ID

        }

      }

    );

 

    console.log(`✅ Stock Reduced in Warehouse`);

 

    res.status(200).json({ message: "Integration Successful!" });

 

  } catch (error) {

    console.error("❌ Error in Integration:", error);

    res.status(500).json({ error: "Integration Failed" });

  }

});

 

// Start Server

const PORT = 5000;

app.listen(PORT, () => console.log(`🚀 Server running on port ${PORT}`));

🚀 How This Works  

  1. A customer pays using Pine Labs POS.

  2. The API verifies the payment with Pine Labs.

  3. A Sales Order is created in Zoho Inventory.

  4. The payment is recorded in Zoho.

  5. The order is marked as delivered.

  6. Stock is automatically reduced from the Flea Market Warehouse.

 

    • Related Articles

    • Integration of Zoho Inventory, Zakya, POS, and WhatsApp for Sales order and customer communication

      Outcome: The outcome of this use case is the successful integration of WhatsApp with Zoho Inventory, Zakya, and PineLabs POS, enabling businesses to automate payment requests, send payment acknowledgments, and deliver invoices to customers directly ...
    • Zoho Store Integration With Zoho Sites

      Zoho Store : The Zoho Partner Store is a secure platform where partners can manage customer orders and subscriptions with ease. Using your Zoho account, you can access tools to add new customers, manage paid plans, and handle upgrades or ...
    • Zoho Commerce Demo Website

      Zoho Commerce Demo Website ( Zoho Commerce) Outcome: The Pink Beauty eCommerce website on Zoho Commerce will deliver a smooth and engaging shopping experience for customers, from browsing to secure checkout and order tracking. For the business, it ...
    • Zoho Store Integration With Zoho Sites

      Zoho Store : The Zoho Partner Store is a secure platform where partners can manage customer orders and subscriptions with ease. Using your Zoho account, you can access tools to add new customers, manage paid plans, and handle upgrades or ...
    • ZOHO RECRUIT ORGANIZATIONAL STRUCTURE

      OUTCOME: The implementation of Zoho Recruit for organizational structure and recruitment processes has yielded significant positive outcomes for the organization. The successful implementation includes a clearly defined project scope, selected and ...