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
id
string  | null 
optional
code
string  | null 
optional
companyId
string  | null 
optional
checkoutToken
string  | null 
optional
cartToken
string  | null 
optional
status
enum<string> 
optional
Allowed values:
DraftPlacedCancelledProcessingToBeShippedShippedPartialDeliveryFailedToDeliverDeliveredRejectedCompletedAllignore
customerId
string  | null 
optional
customerTin
string  | null 
optional
customerName
string  | null 
optional
customerCode
string  | null 
optional
currency
enum<string> 
optional
Allowed values:
aedafnallamdangaoaarsaudawgaznbambbdbdtbgnbhdbifbmdbndbobbovbrlbsdbtnbwpbynbzdcadcdfchechfchwclfclpcnycopcoucrccuccupcveczkdjfdkkdopdzdegpernetbeurfjdfkpgbpgelghsgipgmdgnfgtqgydhkdhnlhrkhtghufidrilsinriqdirriskjmdjodjpykeskgskhrkmfkpwkrwkwdkydkztlaklbplkrlrdlsllydmadmdlmgamkdmmkmntmopmrumurmvrmwkmxnmxvmyrmznnadngnnionoknprnzdomrpabpenpgkphppkrplnpygqarronrsdrubrwfsarsbdscrsdgseksgdshpsllsossrdsspstnsvcsypszlthbtjstmttndtoptryttdtwdtzsuahugxusdusnuyiuyuuywuzsvesvndvuvwstxafxagxauxbaxbbxbcxbdxcdxdrxofxpdxpfxptxsuxtsxuaxxxyerzarzmwzwlignore
discountRate
number <double>
optional
discountValue
number <double>
optional
totalAmount
number <double>
optional
netAmount
number <double>
optional
vatAmount
number <double>
optional
expenseAmount
number <double> | null 
optional
financialStatus
enum<string> 
optional
Allowed values:
PendingAuthorizedPartiallyPaidPartiallyRefundedRefundedVoided
fulfillmentStatus
enum<string> 
optional
Allowed values:
FulfilledNullPartialRestocked
billingAddress
object (AddressDTO) 
optional
address1
string  | null 
optional
>= 0 characters<= 100 characters
address2
string  | null 
optional
>= 0 characters<= 100 characters
firstName
string  | null 
optional
>= 0 characters<= 100 characters
lastName
string  | null 
optional
>= 0 characters<= 100 characters
city
string  | null 
optional
>= 0 characters<= 60 characters
state
string  | null 
optional
>= 0 characters<= 50 characters
country
string  | null 
optional
>= 0 characters<= 55 characters
countryCode
string  | null 
optional
postalCode
string  | null 
optional
>= 0 characters<= 15 characters
phoneNumber
string  | null 
optional
>= 0 characters<= 100 characters
email
string <email> | null 
optional
>= 0 characters<= 55 characters
shippingAddress
object (AddressDTO) 
optional
requiresCalculation
boolean  | null 
optional
lines
array[object (OrderLineDTO) {28}]  | null 
optional
id
string  | null 
optional
productId
string  | null 
optional
productVariantId
string  | null 
optional
productTitle
string  | null 
optional
unitId
string  | null 
optional
salesUnitId
string  | null 
optional
quantity
number <double> | null 
optional
unitQuantity
number <double>
optional
netValue
number <double>
optional
price
number <double>
optional
expenseValue
number <double> | null 
optional
priceValue1
number <double> | null 
optional
priceValue2
number <double> | null 
optional
priceValue3
number <double> | null 
optional
unitPrice
number <double>
optional
lineValue
number <double>
optional
discountValue
number <double>
optional
discountRate
number <double>
optional
vatValue
number <double>
optional
vatRate
number <double>
optional
vatCode
string  | null 
optional
sku
string  | null 
optional
dimension1Caption
string  | null 
optional
dimension2Caption
string  | null 
optional
dimension3Caption
string  | null 
optional
dimension1Value
string  | null 
optional
dimension2Value
string  | null 
optional
dimension3Value
string  | null 
optional
vatAnalysis
array[object (VatAnalysisDTO) {4}]  | null 
optional
vatRate
number <double> | null 
optional
vatAmount
number <double> | null 
optional
vatCode
string  | null 
optional
netAmount
number <double> | null 
optional
tags
array[string] | null 
optional
sourceId
string  | null 
optional
sourceTags
array[string] | null 
optional
notes
string  | null 
optional
updateDate
string <date-time> | null 
optional
insertDate
string <date-time> | null 
optional
favorite
boolean  | null 
optional
userId
string  | null 
optional
invoiceUrl
string  | null 
optional
notify
string  | null 
optional
notified
array[string] | null 
optional
customFields
array[object (OrderCustomFieldDTO) {3}]  | null 
optional
name
string  | null 
optional
value
null 
optional
translation
object (OrderCustomFieldTranslationDTO) 
optional
shippingLine
object (ShippingLineDTO) 
optional
carrierId
string  | null 
optional
carrierCode
string  | null 
optional
title
string  | null 
optional
type
enum<string> 
optional
Allowed values:
ManualAfterSalesProAcsGenikiTaxidromikiignore
netPrice
number <double> | null 
optional
totalAmount
number <double> | null 
optional
vatLines
array[object (ShippingVatDTO) {2}]  | null 
optional
giftLines
array[object (GiftLineDTO) {7}]  | null 
optional
productId
string  | null 
optional
productVariantId
string  | null 
optional
productTitle
string  | null 
optional
quantity
number <double> | null 
optional
vatCode
string  | null 
optional
imageLink
string  | null 
optional
productAlias
string  | null 
optional
expenseLines
array[object (ExpenseLineDTO) {3}]  | null 
optional
id
string  | null 
optional
netValue
number <double>
optional
vatValue
number <double>
optional
payment
object (OrderPaymentDTO) 
optional
id
string  | null 
optional
code
string  | null 
optional
provider
enum<string> 
optional
Allowed values:
OnePayEveryPayCreditPayPalDepositPayGateCardLinkEDPSJCCCODStripeKlarnaEpayNexiignore
status
enum<string> 
optional
Allowed values:
SubmittedCompletedPendingCancelledFailedErrorignore
cardType
enum<string> 
optional
Allowed values:
OtherVisaMastercardignore
paymentDate
string <date-time> | null 
optional
amount
number <double>
optional
approvalCode
string  | null 
optional
cardNumber
string  | null 
optional
postDating
integer <int32> | null 
optional
installments
integer <int32> | null 
optional
bankId
string  | null 
optional
transactionId
string  | null 
optional
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
customerId
string  | null 
optional
customerCode
string  | null 
optional
items
array[object (CatalogPricingItemDTO) {10}]  | null 
optional
productId
string  | null 
optional
productVariantId
string  | null 
optional
sku
string  | null 
optional
initialUnitPrice
number <double> | null 
optional
unitPrice
number <double> | null 
optional
initialPrice
number <double> | null 
optional
price
number <double> | null 
optional
value1
number <double> | null 
optional
value2
number <double> | null 
optional
value3
number <double> | null 
optional
customerSourceId
string  | null 
optional
Example Response:
[
  {
    "ProductId": "P123",
    "ProductVariantId": "V001",
    "InitialPrice": 100.00,
    "Price": 90.00
  },
  {
    "ProductId": "P124",
    "ProductVariantId": "V002",
    "InitialPrice": 150.00,
    "Price": 140.00
  }
]
ExternalCatalogPricingDTO
productId
string  | null 
optional
productVariantId
string  | null 
optional
initialUnitPrice
number <double> | null 
optional
unitPrice
number <double> | null 
optional
initialPrice
number <double> | null 
optional
price
number <double> | null 
optional
sku
string  | null 
optional
value1
number <double> | null 
optional
value2
number <double> | null 
optional
value3
number <double> | null 
optional
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
customerId
string  | null 
optional
customerSourceId
string  | null 
optional
customerCode
string  | null 
optional
totalAmount
number <double> | null 
optional
netAmount
number <double> | null 
optional
vatAmount
number <double> | null 
optional
expenseAmount
number <double> | null 
optional
discountRate
number <double> | null 
optional
discountValue
number <double> | null 
optional
giftLines
array[object (GiftLineDTO) {7}]  | null 
optional
productId
string  | null 
optional
productVariantId
string  | null 
optional
productTitle
string  | null 
optional
quantity
number <double> | null 
optional
vatCode
string  | null 
optional
imageLink
string  | null 
optional
productAlias
string  | null 
optional
items
array[object (CalculatedPricingItemDTO) {16}]  | null 
optional
productId
string  | null 
optional
productVariantId
string  | null 
optional
sku
string  | null 
optional
quantity
number <double> | null 
optional
netValue
number <double> | null 
optional
initialUnitPrice
number <double> | null 
optional
unitPrice
number <double> | null 
optional
initialPrice
number <double> | null 
optional
price
number <double> | null 
optional
lineValue
number <double> | null 
optional
expenseValue
number <double> | null 
optional
discountValue
number <double> | null 
optional
discountRate
number <double> | null 
optional
vatValue
number <double> | null 
optional
vatRate
number <double> | null 
optional
vatCode
string  | null 
optional
vatAnalysis
array[object (PricingVatAnalysisDTO) {4}]  | null 
optional
vatRate
number <double> | null 
optional
vatAmount
number <double> | null 
optional
vatCode
string  | null 
optional
netAmount
number <double> | null 
optional
expenseLines
array[object (ExpenseLineDTO) {3}]  | null 
optional
id
string  | null 
optional
netValue
number <double>
optional
vatValue
number <double>
optional
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"
  },
  ...
]
Previous
Log Stream
Next
Getting Started
Built with