Sanal AI
  1. API Requirements
Sanal AI
  • Introduction
    • ๐Ÿš€ Sanal AI - Encore Data
    • ๐Ÿ› ๏ธ Getting Started
    • ๐Ÿค The Approach / Model
  • Data Structures
    • ๐Ÿ“ Data Layout
    • ๐Ÿช Merchants
    • ๐Ÿ“‚ Categories
    • ๐Ÿท๏ธ Items
    • ๐Ÿ›’ Products
    • ๐Ÿ“ฆ Inventory
    • ๐Ÿ‘ค Customers
    • ๐Ÿงพ Orders
    • ๐Ÿงพ Variants & Combinations
  • API Requirements
    • ๐Ÿ”Œ API Requirements
    • API: `syncMerchants`
    • API: `syncCategories`
    • API: `syncItems`
    • API: `syncProducts`
    • API: `syncInventory`
    • API: `syncCustomers`
    • API: `syncOrders`
  1. API Requirements

API: `syncMerchants`

This endpoint is used to synchronize merchant records between Encore and deepsense.
Endpoint: POST /v1/syncMerchants

Request Payload#

The request body contains a list of merchant objects, each with a command.
KeyTypeDescription
commandstringThe action to perform: "create", "update", or "delete".
infoobjectThe full Merchant data object. For delete, only the id is required.
Sample Request Body#
{
  "merchants": [
    {
      "command": "create",
      "info": {
        "id": "mer_new_coffee_shop",
        "name": "Jeddah Coffee Corner",
        "updated_at": "2025-10-16T15:00:00Z"
      }
    },
    {
      "command": "delete",
      "info": {
        "id": "mer_old_store_123"
      }
    }
  ]
}

Response Payload#

The response reports only on failed operations.
Sample Error Response#
{
  "status": "partial_failure",
  "errors": [
    {
      "id": "mer_new_coffee_shop",
      "error": {
        "code": "VALIDATION_ERROR",
        "message": "Field 'legal_name' cannot be empty."
      }
    }
  ]
}
Previous
๐Ÿ”Œ API Requirements
Next
API: `syncCategories`
Built with