HomeWiki
HomeWiki
  1. Home
  • Back to home
  • 2. Connectivity
  • Introduction
  • Custom Script
  • Playground
  • Database Explorer
  • Log Stream
  • Direct Communication
  • Softone
    • Getting Started
  • Datapump
    • Getting Started
    • Crons
    • Legacy Windows Support
    • SDK
      • DB
        • _executeQuery
        • _executeStoreProcedure
        • _executeInsertQuery
        • _executeInsertQueriesInTransaction
      • Import
        • _productsImport
        • _categoriesImport
        • _brandsImport
        • _attributesImport
        • _attributeSetsImport
        • _unitsImport
        • _quantityImport
        • _customersImport
        • _contactsImport
        • _callsImport
        • _eventsImport
        • _tasksImport
        • _ordersImport
        • _usersImport
        • _customerSourceTagsImport
        • _productSourceTagsImport
      • Log
        • _logDebug
        • _logInfo
        • _logWarn
        • _logError
      • Web Requests
        • _httpGetJson
        • _httpPostJson
        • _httpPutJson
        • _httpDeleteJson
        • _httpPatchJson
      • Variables
        • _saveVariable
        • _getVariable
        • _deleteVariable
      • Blob
        • _blobConnect
        • _blobExists
        • _blobGet
        • _blobFind
      • Utils
        • _encodeBase64
        • _sleep
        • _getLastSyncDate
        • _updateLastSyncDate
        • _resetLastSyncDate
  1. Home

Direct Communication

Direct Communication Between Shopranos Platform and Datapump: Core Functions#

The Shopranos platform supports direct communication with Datapump, enabling the retrieval and update of information from your ERP system through custom functions. These core functions are essential for handling various operations such as order processing, pricing calculations, and customer account management. Datapump currently supports five core functions: CreateOrder, CalculatePrices, CalculateCatalogPrices, GetCustomerBalance, and GetCustomerTransactions.

Core Functions Overview:#

1.
CreateOrder:
Purpose: Triggered when an order is placed on the Shopranos platform, this function creates the corresponding order in your ERP system.
Payload: The payload includes the Shopranos order model with details such as customer information, items, and totals.
Expected Response: A response object with an Id property representing the ID of the newly created order record in the ERP system.
Example Payload:
{
  "Code": "ORD12345",
  "CustomerSourceId": "100",
  "lines": [
    { "ProductId": "P123", "Quantity": 2 },
    ...
  ],
  "TotalAmount": 199.99
}
Example Response:
{
  "Id": "ERP12345"
}
OrderDTO

2.
CalculateCatalogPrices:
Purpose: Used when Shopranos operates in connector mode for catalog pricing, this function calculates and retrieves the correct prices for products based on the customer context.
Payload:
CustomerSourceId: Identifies the customer for whom prices are being calculated.
Items: A list of items needing pricing, each containing ProductId and ProductVariantId.
Expected Response: A list of items with the following properties:
ProductId
ProductVariantId
InitialPrice
Price
Example Payload:
{
  "CustomerSourceId": "CUST001",
  "Items": [
    { "ProductId": "P123", "ProductVariantId": "V001" },
    { "ProductId": "P124", "ProductVariantId": "V002" }
  ]
}
CatalogPricingDTO

Example Response:
[
  {
    "ProductId": "P123",
    "ProductVariantId": "V001",
    "InitialPrice": 100.00,
    "Price": 90.00
  },
  {
    "ProductId": "P124",
    "ProductVariantId": "V002",
    "InitialPrice": 150.00,
    "Price": 140.00
  }
]
ExternalCatalogPricingDTO

3.
CalculatePrices:
Purpose: This function is used when Shopranos operates in connector mode for cart pricing, allowing it to calculate the correct price for items in the customer's cart.
Payload:
CustomerSourceId: Identifies the customer for whom the cart prices are being calculated.
Items: A list of items in the cart, each containing ProductId, ProductVariantId, and Quantity.
Expected Response: A cart object with pricing details:
NetAmount: Total net amount.
TotalAmount: Total amount including VAT.
VatAmount: Total VAT amount.
ExpenseAmount: Additional expenses.
CustomerId
CustomerBranchId
GiftLines: List of gift items (if any).
VatAnalysis: Breakdown of VAT details.
Items: Detailed list of items in the cart.
ExpenseLines: List of additional expenses.
Example Payload:
{
  "CustomerSourceId": "CUST001",
  "Items": [
    { "ProductId": "P123", "ProductVariantId": "V001", "Quantity": 2 },
    ...
  ]
}
Example Response:
{
  "NetAmount": 180.00,
  "TotalAmount": 216.00,
  "VatAmount": 36.00,
  "ExpenseAmount": 10.00,
  "CustomerId": 1,
  "CustomerBranchId": 101,
  "GiftLines": [],
  "VatAnalysis": [],
  "Items": [],
  "ExpenseLines": []
}
CalculatedPricingDTO

4.
GetCustomerBalance:
Purpose: Retrieves the balance of a specific customer, typically used when Shopranos operates in connector mode for customer transactions.
Payload:
CustomerSourceId: Identifies the customer whose balance is being retrieved.
Expected Response: A balance object containing:
CustomerSourceId
Period
FiscalYear
Debit
Credit
Turnover
Example Payload:
{
  "CustomerSourceId": "CUST001"
}
Example Response:
{
  "CustomerSourceId": "CUST001",
  "Period": "2024-01",
  "FiscalYear": 2024,
  "Debit": 500.00,
  "Credit": 300.00,
  "Turnover": 200.00
}
5.
GetCustomerTransactions:
Purpose: Retrieves the transactions of a specific customer, used when Shopranos operates in connector mode for customer transactions.
Payload:
CustomerSourceId: Identifies the customer whose transactions are being retrieved.
DateFrom: Start date for the transaction period.
DateTo: End date for the transaction period.
Expected Response: A list of transactions, each containing:
Id
CustomerSourceId
CustomerBranchSourceId
Code
Credit
Debit
Turnover
Notes
DocumentId
UpdateDate
ProgressiveBalance
InvoiceUrl
Example Payload:
{
  "CustomerSourceId": "CUST001",
  "DateFrom": "2024-01-01",
  "DateTo": "2024-02-01"
}
Example Response:
[
  {
    "Id": "TXN123",
    "CustomerSourceId": "CUST001",
    "CustomerBranchSourceId": "BR001",
    "Code": "INV001",
    "Credit": 100.00,
    "Debit": 0.00,
    "Turnover": 100.00,
    "Notes": "Payment for invoice INV001",
    "DocumentId": "DOC123",
    "UpdateDate": "2024-01-15T10:00:00",
    "ProgressiveBalance": 1000.00,
    "InvoiceUrl": "https://example.com/invoice/INV001"
  },
  ...
]
Modified at 2024-08-26 11:19:09
Previous
Log Stream
Next
Getting Started
Built with