KARAM Singapore – Oracle Integration Handover Documentation

Overview

This documentation provides a comprehensive handover for the KARAM Singapore Oracle Integration, which automates the flow of Purchase Orders (PO) between Zoho Inventory and the Oracle ERP system. The integration ensures real-time synchronization of purchase orders, quotations, invoices, and shipment statuses for subsidiaries such as PN International, KStrong Asia, and Karam Safety.

Objective

The main objective of this integration is to streamline the purchase workflow by automatically creating Oracle quotations from POs generated in Zoho Inventory and maintaining bidirectional synchronization for PO statuses such as Booked, Picked, Invoiced, and Cancelled.


Architecture Overview

Integration Flow

  1. PO Creation in Zoho Inventory:
    When a purchase order is created for specific vendors (PN International, KStrong Asia, or Karam Safety), a custom button named Send to Oracle becomes available.

  2. Trigger to Oracle:
    On button click, a Deluge function constructs a detailed JSON payload with PO header, item lines, and delivery address, and sends it to Oracle via REST API.

  3. Oracle Quote Creation:
    The Oracle ERP system receives this data and automatically creates a quotation entry in its system, maintaining a linkage with the Zoho PO ID.

  4. Oracle Status Sync Back to Zoho:
    Oracle sends status updates item-wise for each PO (e.g., Booked, Picked, Invoiced, Cancelled) through an inbound webhook endpoint.

  5. Zoho PO Update:
    Based on the Oracle response, Zoho updates PO status fields and maintains activity logs for tracking.


Technical Components

1. Deluge Function – Send to Oracle

This is a custom function in Zoho Inventory triggered by a button. It gathers PO details, validates the vendor, prepares the payload, and sends it to Oracle.

2. API Endpoint (Oracle)

https://karamoic-prod-fr87ewud34mdw-fr.integration.eu-frankfurt-1.ocp.oraclecloud.com/ic/api/integration/v1/flows/rest/KARAM_KSTRONG_ASIA_ZOHO_INT/1.0/karamlead

3. Authentication

The Oracle API requires Basic Authentication.

"Authorization": "Basic YWppdC5zYXByYUBrYXJhbS5pbjpBc2FwQDIwMDkxOTk1"

4. Key Custom Fields in Zoho Inventory

Field API Name

Description

cf_oracle_updation

Tracks the Oracle integration status (Pending, Sended, Error).

vendor_name

Identifies if the PO vendor is part of the Oracle-linked subsidiaries.

line_items

Contains individual product and pricing details.

delivery_address

Used for generating ShipToAddress in Oracle payload.


Integration Logic Flow

Step-by-Step Breakdown

  1. PO Validation:

    if(vendorName == "PN International Private Limited" || vendorName == "KStrong Asia Pte Ltd" || vendorName == "Karam Safety Private Limited" && oracle_sended != "Sended")
    

    This condition ensures only eligible vendors trigger Oracle sync and avoids re-sending already synced POs.

  2. Header Mapping:

    orcaleData.put("PONumber_c", purchaseorderID);
    orcaleData.put("PoDate_c", datePO);
    orcaleData.put("AccountCustom_c", "KSTRONG ASIA PTE LTD");
    orcaleData.put("Currency_c", "USD");
    orcaleData.put("Organization_c", "IM");
    
  3. Line Item Construction:
    Each item in line_items is transformed into Oracle’s transactionLines object.

    product = Map();
    product.put("unitPrice", item.get("rate"));
    product.put("quantity", item.get("quantity"));
    product.put("extendedPrice", item.get("item_total"));
    product.put("description", item.get("description"));
    product.put("partNumber", item.get("sku"));
    
  4. Error Handling for Missing Oracle Items:

    if(ose_value.get("value") == false)
    {
        errorMessage.put(item.get("sku"), "is not available in OSC.");
    }
    

    Items not available in Oracle will be logged and skipped from sending.

  5. Payload Transmission:

    response = invokeurl
    [
        url : orcaleAPi
        type : POST
        parameters: orcaleData.toString()
        headers: headers
    ];
    
  6. Response Handling:
    On success, Oracle returns the following IDs:

    {
      "LeadNumber": "12345",
      "LeadId": "98765",
      "OptyId": "34567",
      "OptyNumber": "KARAM-2025-01",
      "transactionID_t": "TXN001"
    }
    

    These values confirm successful record creation on Oracle and trigger the update of Zoho’s cf_oracle_updation field to Sended.

  7. Oracle Error Handling:
    If Oracle responds with error code CASDK-0033, it still marks the PO as Sended since the record exists in Oracle.


API Payload Example (Oracle)

{
  "status": "Booked",
  "poId": "5488792000007194590",
  "data": {
    "HEADER_DETAIL": {
      "CustomerName": "KSTRONG",
      "CustomerNumber": "1234",
      "CustomerPO": "PO-00134",
      "PODate": "2025-09-25",
      "SalesOrder_No": "12345",
      "Currency": "USD",
      "Warehouse": "KIO",
      "OrderStatus": "Booked",
      "ARInvoiceNo": "INV001",
      "ARInvoiceDate": "2025-09-25",
      "ARInvoiceAmount": "150"
    },
    "LINE_DETAIL": [
      {
        "LineNo": "1",
        "ItemCode": "AFH300051",
        "OrderedQty": 2,
        "UnitSellingPrice": "50",
        "ExtendedPrice": "100",
        "PromiseDate": "2025-09-25",
        "OrderLineStatus": "Picked"
      }
    ]
  }
}


Conclusion

The KARAM Singapore Oracle Integration enables smooth, automated synchronization between Zoho Inventory and Oracle ERP, reducing manual intervention and ensuring data consistency across global subsidiaries. With robust validation, logging, and item-wise tracking, this setup ensures reliability and scalability for enterprise operations.


On this page