Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagejs
{  
   "modelUpdates":[  
      {  
         "modelType":"CreateSalesOrderItemModelUpdate",
         "financialData":{  
            "priceIncludesVat" // should always be true,
            "saleFinancialAccountNumber" // [financial_account_number],
            "vatAccountNumber" // should be taken from [vat_type] if presented, else - undefined
            "vatRate" // should be taken from [vat_type] if presented, else - undefined
            "discountAccountNumber" // should be taken from [vat_type] if presented, else - undefined
            "usedVatFinancialAccountNumber" // should be taken from [vat_type] else - undefined
            "usedVatRate" // should be taken from [vat_type] if presented, else - undefined
         },
         "manualDiscountAmount" // [manual_discount]
         "quantity" // [quantity],
         "inventoryItemData":{  
            "displayName" // from [product]
            "productId" // from [product]
            "variantId" // from [product_instance] if presented, , else - undefined,
            "instanceId" // from [product_instance] if presented, else - undefined
            "productIdentifier" // from [product_variant]
            "isUserDefinedPriceAllowed // from [product]
            "isCustomDisplayNameAllowed // from [product]
            "costPrice" // [cost_price]
            "isUsed"from [product_instance] if presented, else - undefined
            "purchasePrice" //from [product_instance] if presented, else - undefined
            "isProductInstanceRequired" from product.isProductInstancesSupported
         },
         "price" - [sales_price]
      },
      {  
         "modelType":"SetSalesOrderCustomerDataModelUpdate",
         "actor":{ // this entire block may be undefined if [customer] is not defined 
            "value":{  
               "actorId"// from [customer]
               "fullName"// Property [ActorText] from [customer]
               "identification// Customer Identifier (from [customer])
            }
         },
         "address":{  // this entire block may be undefined if [address] is not defined 
            "value":{  
               "addressLine1" // from [address], required
               "addressLine2" // from [address]
               "postalCode" // from [address], required
               "postalDistrict" // from [address]
               "country" // from [address], required
               "latitude" // from [address]
               "longitude" // from [address]
            }
         },
         "email":{   // this entire block may be undefined if [email] is not defined 
            "value" // [email] itself
         },
         "phone":{  // this entire block may be undefined if [phone]  is not defined 
            "value" // [phone] itself
         }
      }
   ],
   "modelType":"CreateSalesOrderCommand"
}

...

Code Block
languagejs
{  
   "modelUpdates":[  
      {  
         "modelType":"CreateSalesOrderItemModelUpdate",
         "financialData":{  
            "priceIncludesVat":true,
            "saleFinancialAccountNumber":1100,
            "vatAccountNumber":14262,
            "vatRate":25,
            "discountAccountNumber":7200,
            "usedVatFinancialAccountNumber":null,
            "usedVatRate":null
         },
         "manualDiscountAmount":300.14,
         "quantity":1,
         "inventoryItemData":{  
            "displayName":"Sony Playstation 4 (cf18-4136-9f92-31764c4)",
            "productId":106,
            "variantId":null,
            "instanceId":165,
            "productIdentifier":"ID_108",
            "isUserDefinedPriceAllowed":false,
            "isCustomDisplayNameAllowed":false,
            "costPrice":3000,
            "isUsed":false,
            "purchasePrice":null,
            "isProductInstanceRequired": true
         },
         "price":3001.45
      },
      {  
         "modelType":"SetSalesOrderCustomerDataModelUpdate",
         "actor":{  
            "value":{  
               "actorId":8,
               "fullName":"0000100001 a_person Customer",
               "identification":"0000100001"
            }
         },
         "address":{  
            "value":{  
               "addressLine1":"myStreet",
               "addressLine2":"222",
               "postalCode":"2100",
               "postalDistrict":"København Ø",
               "country":"Denmark",
               "latitude":null,
               "longitude":null,
            }
         },
         "email":{  
            "value":"example@gmail.com"
         },
         "phone":{  
            "value":"77777777"
         }
      }
   ],
   "modelType":"CreateSalesOrderCommand"
}

...

Code Block
languagejs
{  
   "modelUpdates":[  
      {  
         "modelType":"CreateInvoiceItemModelUpdate",
         "financialData":{  
            "priceIncludesVat" // should always be true,
            "saleFinancialAccountNumber" // [financial_account_number],
            "vatAccountNumber" // should be taken from [vat_type] if presented, else - undefined
            "vatRate" // should be taken from [vat_type] if presented, else - undefined
            "discountAccountNumber" // should be taken from [vat_type] if presented, else - undefined
            "usedVatFinancialAccountNumber" // should be taken from [vat_type] else - undefined
            "usedVatRate" // should be taken from [vat_type] if presented, else - undefined
         },
         "manualDiscountAmount" // [manual_discount]
         "quantity" // [quantity],
         "inventoryItemData":{  
            "displayName" // from [product]
            "productId" // from [product]
            "variantId" // from [product_instance] if presented, , else - undefined,
            "instanceId" // from [product_instance] if presented, else - undefined
            "productIdentifier" // from [product_variant]
            "isUserDefinedPriceAllowed // from [product]
            "isCustomDisplayNameAllowed // from [product]
            "costPrice" // from [product_instance] if presented, else - undefined
            "isUsed"from [product_instance] if presented, else - undefined
            "purchasePrice" //from [product_instance] if presented, else - undefined
            "isProductInstanceRequired" from product.isProductInstancesSupported
         },
         "price" - [sales_price]
      },
      {  
         "modelType":"SetInvoiceCustomerDataModelUpdate",
         "actor":{ // this entire block may be undefined if [customer] is not defined 
            "value":{  
               "actorId"// from [customer]
               "fullName"// from [customer]
               "identification// from [customer]
            }
         },
         "address":{  // this entire block may be undefined if [address] is not defined 
            "value":{  
               "addressLine1" // from [address], required
               "addressLine2" // from [address]
               "postalCode" // from [address], required
               "postalDistrict" // from [address]
               "country" // from [address], required
               "latitude" // from [address]
               "longitude" // from [address]
            }
         },
         "email":{   // this entire block may be undefined if [email] is not defined 
            "value" // [email] itself
         },
         "phone":{  // this entire block may be undefined if [phone]  is not defined 
            "value" // [phone] itself
         }
      }
   ],
   "modelType":"CreateInvoiceAndReserveCommand"
}

...

Code Block
languagejs
{  
   "modelUpdates":[  
      {  
         "modelType":"CreateInvoiceItemModelUpdate",
         "financialData":{  
            "priceIncludesVat":true,
            "saleFinancialAccountNumber":1100,
            "vatAccountNumber":14262,
            "vatRate":25,
            "discountAccountNumber":7200,
            "usedVatFinancialAccountNumber":null,
            "usedVatRate":null
         },
         "manualDiscountAmount":300.14,
         "quantity":1,
         "inventoryItemData":{  
            "displayName":"Sony Playstation 4 (cf18-4136-9f92-31764c4)",
            "productId":106,
            "variantId":null,
            "instanceId":165,
            "productIdentifier":"ID_108",
            "isUserDefinedPriceAllowed":false,
            "isCustomDisplayNameAllowed":false,
            "costPrice":3000,
            "isUsed":false,
            "purchasePrice":null,
            "isProductInstanceRequired": true
         },
         "price":3001.45
      },
      {  
         "modelType":"SetInvoiceCustomerDataModelUpdate",
         "actor":{  
            "value":{  
               "actorId":8,
               "fullName":"0000100001 a_person Customer",
               "identification":"0000100001"
            }
         },
         "address":{  
            "value":{  
               "addressLine1":"myStreet",
               "addressLine2":"222",
               "postalCode":"2100",
               "postalDistrict":"København Ø",
               "country":"Denmark",
               "latitude":null,
               "longitude":null,
            }
         },
         "email":{  
            "value":"example@gmail.com"
         },
         "phone":{  
            "value":"77777777"
         }
      }
   ],
   "modelType":"CreateInvoiceAndReserveCommand"
}

...

Code Block
languagejs
{  
   "modelUpdates":[  
      {  
         "modelType":"CreateInvoiceItemModelUpdate",
         "salesOrderItemReference":{  
            "value":{  
               "salesOrderId" // from [sale_order]
               "salesOrderIdentifier // from [sale_order]
               "salesOrderItemId" // from [sale_order_item]
            }
         },
         "financialData":{  // just copy from property with same name from [sale_order_item] or change if needed
            "saleFinancialAccountNumber"
            "vatRate"
            "vatAccountNumber"
            "discountAccountNumber"
            "priceIncludesVat"
            "usedVatRate"
            "usedVatFinancialAccountNumber"
         },
         "manualDiscountAmount"// just copy from property with same name from [sale_order_item] or change if needed
         "quantity"// just copy from property with same name from [sale_order_item] or change if needed
         "inventoryItemData":{  // just copy from property with same name from [sale_order_item] or change if needed
            "displayName"
            "productId"
            "variantId"
            "instanceId"
            "productIdentifier"
            "isUserDefinedPriceAllowed"
            "isCustomDisplayNameAllowed"
            "costPrice"
            "isUsed"
            "purchasePrice",
            "isProductInstanceRequired"
         },
         "price"// just copy from property with same name from [sale_order_item] or change if needed
      },
      {  
         "modelType":"SetInvoiceCustomerDataModelUpdate",
         "customerDescriptor":{  // copy from property [customer] of [sale_order] or compose based on [customer]
            "value":{  
               "actorId"
               "fullName"
               "identification"
            }
         },
         "firstName":{  
            "value" // take from [customer] if possible or user input
         },
         "lastName":{  
            "value" // take from [customer] if possible or user input
         },
         "organizationName":{  
            "value" // take from [customer] if possible or user input
         },
         "address":{ // take from [customer] if possible or user input  
            "value":{  
               "addressLine1"
               "addressLine2"
               "postalCode"
               "postalDistrict"
               "country"
               "latitude"
               "longitude"
            }
         },
         "email":{  
            "value" // take from [customer] if possible or user input
         },
         "phone":{  
            "value" // take from [customer] if possible or user input
         }
      }
   ],
   "modelType":"CreateInvoiceCommand"
}

...

Code Block
languagejs
{  
   "modelUpdates":[  
      {  
         "modelType":"CreateInvoiceItemModelUpdate",
         "salesOrderItemReference":{  
            "value":{  
               "salesOrderId":1,
               "salesOrderIdentifier":"0000000001",
               "salesOrderItemId":1
            }
         },
         "financialData":{  
            "saleFinancialAccountNumber":1100,
            "vatRate":25,
            "vatAccountNumber":14262,
            "discountAccountNumber":7200,
            "priceIncludesVat":true,
            "usedVatRate":null,
            "usedVatFinancialAccountNumber":null
         },
         "manualDiscountAmount":300.14,
         "quantity":1,
         "inventoryItemData":{  
            "displayName":"Sony Playstation 4 (cf18-4136-9f92-31764c4)",
            "productId":106,
            "variantId":null,
            "instanceId":165,
            "productIdentifier":"ID_108",
            "isUserDefinedPriceAllowed":false,
            "isCustomDisplayNameAllowed":false,
            "costPrice":3000,
            "isUsed":false,
            "purchasePrice":null,
            "isProductInstanceRequired": true
         },
         "price":3001.45
      },
      {  
         "modelType":"SetInvoiceCustomerDataModelUpdate",
         "customerDescriptor":{  
            "value":{  
               "actorId":8,
               "fullName":"0000100001 a_person Customer",
               "identification":"0000100001"
            }
         },
         "firstName":{  
            "value":"a_person"
         },
         "lastName":{  
            "value":"Customer"
         },
         "organizationName":{  
            "value":null
         },
         "ean":{  

         },
         "address":{  
            "value":{  
               "addressLine1":"myStreet",
               "addressLine2":"222",
               "postalCode":"2100",
               "postalDistrict":"København Ø",
               "country":"Denmark",
               "latitude":null,
               "longitude":null
            }
         },
         "email":{  
            "value":"example@gmail.com"
         },
         "phone":{  
            "value":"77777777"
         }
      },
      {  
         "modelType":"SetInvoiceProductInstanceModelUpdate",
         "productInstance":{  
            "productInstanceId":null,
            "displayValue":"",
            "productId":null,
            "productVariantId":null
         }
      },
      {  
         "modelType":"SetInvoicePaymentDueDateModelUpdate",
         "paymentDueDate":"2018-09-27T13:38:46+03:00"
      }
   ],
   "modelType":"CreateInvoiceCommand"
}

...