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.
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.
{
"Code": "ORD12345",
"CustomerSourceId": "100",
"lines": [
{ "ProductId": "P123", "Quantity": 2 },
...
],
"TotalAmount": 199.99
}
2.
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.
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: {
"CustomerSourceId": "CUST001",
"Items": [
{ "ProductId": "P123", "ProductVariantId": "V001" },
{ "ProductId": "P124", "ProductVariantId": "V002" }
]
}
[
{
"ProductId": "P123",
"ProductVariantId": "V001",
"InitialPrice": 100.00,
"Price": 90.00
},
{
"ProductId": "P124",
"ProductVariantId": "V002",
"InitialPrice": 150.00,
"Price": 140.00
}
]
ExternalCatalogPricingDTO
3.
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.
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.
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.
{
"CustomerSourceId": "CUST001",
"Items": [
{ "ProductId": "P123", "ProductVariantId": "V001", "Quantity": 2 },
...
]
}
{
"NetAmount": 180.00,
"TotalAmount": 216.00,
"VatAmount": 36.00,
"ExpenseAmount": 10.00,
"CustomerId": 1,
"CustomerBranchId": 101,
"GiftLines": [],
"VatAnalysis": [],
"Items": [],
"ExpenseLines": []
}
4.
Purpose: Retrieves the balance of a specific customer, typically used when Shopranos operates in connector mode for customer transactions.
CustomerSourceId: Identifies the customer whose balance is being retrieved.
Expected Response: A balance object containing: {
"CustomerSourceId": "CUST001"
}
{
"CustomerSourceId": "CUST001",
"Period": "2024-01",
"FiscalYear": 2024,
"Debit": 500.00,
"Credit": 300.00,
"Turnover": 200.00
}
5.
Purpose: Retrieves the transactions of a specific customer, used when Shopranos operates in connector mode for customer transactions.
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: {
"CustomerSourceId": "CUST001",
"DateFrom": "2024-01-01",
"DateTo": "2024-02-01"
}
[
{
"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