PLG GROUP

Secure API Gateway Documentation

VERSION 1.2.0

Search CRM Contact & Account

Queries Zoho CRM for a contact by email and retrieves associated Account information, including Shipping and Billing addresses.

GET /getContact?email={email}

Authentication

Include the following header in your request:

Header Key Required Description
x-api-key YES Your private PLG Group API Key.

Response Samples

200 OK Success Response (Enhanced Data)

{
  "status": "success",
  "data": {
    "id": "550428000008877665",
    "First_Name": "Poligon",
    "Last_Name": "Mühendislik",
    "Email": "info@poligonmuhendislik.com",
    "Account_Info": {
      "id": "550428000002233445",
      "Name": "Poligon Mühendislik San. ve Tic. Ltd. Şti.",
      "Shipping_Address": {
        "street": "Tahtalı Mah. Kiteyol Sok. No: 24",
        "city": "Bursa",
        "state": "Nilüfer",
        "code": "16110",
        "country": "Türkiye"
      },
      "Billing_Address": {
        "street": "Tahtalı Mah. Kiteyol Sok. No: 24",
        "city": "Bursa",
        "state": "Nilüfer",
        "code": "16110",
        "country": "Türkiye"
      }
    }
  }
}

404 NOT FOUND No Record

{
  "status": "not_found",
  "message": "No record found."
}

400 BAD REQUEST Validation Error

{
  "status": "error",
  "message": "Invalid or missing email format."
}

Create Sales (Transactional)

Creates a full sales process in Zoho CRM including Deal, Quote, and Sales Order. This endpoint is transactional: if any step fails, all created records are automatically deleted (rollback).

POST /createSales

Authentication

Header Key Required Description
x-api-key YES Private API Key

Request Body

Field Type Required Description
contactId string YES Zoho Contact ID
products array YES Product list

Example:

{
  "contactId": "550428000008877665",
  "products": [
    {
      "productId": "550428000000111222",
      "quantity": 2
    },
    {
      "productId": "550428000000333444",
      "quantity": 5
    }
  ]
}

Business Logic

  • Products are fetched from Zoho CRM dynamically
  • Deal is created first
  • Quote is created only if Deal is successful
  • Sales Order is created only if Quote is successful
  • If any step fails → all records are deleted (rollback)

Response

200 OK Success

{
  "status": "success",
  "message": "Success."
}

500 ERROR Failure

{
  "status": "failed",
  "message": "Failed."
}

Error Handling

  • If Deal creation fails → process stops
  • If Quote creation fails → Deal is deleted
  • If Sales Order fails → Quote and Deal are deleted
  • Error notification email is sent automatically to IT team

System Notification

Email Trigger:
Recipient: it@poligonmuhendislik.com

Content:
- Error Message
- Deal ID (if created)
- Quote ID (if created)
- Sales Order ID (if created)
© 2026 PLG GROUP IT DEPARTMENT