Appearance
Hooks ​
Hooks are a moment in the lifetime of the application where you can extend or change the default behavior of the application.
🧩 PreItemSyncFinalizeHookContext
Hook is invoked before the finalization of a single item synchronization, allowing for last-minute adjustments or validations.
| Property name | Type | Description |
|---|---|---|
event | PreItemSyncFinalizeHookContextEvent | - |
| Method | Description |
|---|---|
setUnitOfMeasure (uomCode: string): void | Update the unit of measure code |
setVatTariffType (vatTariffType: 'Normal' | 'Low1' | 'Low2' | 'SuperLow' | 'ParkingTariff' | 'NoVat'): void | Set vat tariff type |
setFamilyCode (familyCode: string): void | Set family code |
createOrUpdateAttribute (attributeKey: string, attributeValue: object): void | Create or update an item attribute |
HookAttribute
| Property name | Type | Description |
|---|---|---|
attributeKey | string | Attribute key |
valueSequence | number | Order for same attribute keys |
boolValue | boolean | null | Boolean value |
textValue | string | Text value |
decimalValue | number | null | Decimal value |
dateTimeValue | Date | null | DateTime value |
guidValue | string | null | Guid value |
HookItemStock
| Property name | Type | Description |
|---|---|---|
warehouse | string | Stock warehouse. |
quantity | number | Stock quantity. |
HookItem
| Property name | Type | Description |
|---|---|---|
itemCode | string | Item code. |
uomCode | string | Unit of measure code. |
familyCode | string | Family code |
vatTariff | 'Normal' | 'Low1' | 'Low2' | 'SuperLow' | 'ParkingTariff' | 'NoVat' | VAT tariff |
attributes | HookAttribute[] | Attributes |
stocks | HookItemStock[] | Stock information |
PreItemSyncFinalizeHookContextEvent
| Property name | Type | Description |
|---|---|---|
item | HookItem | - |
🧩 PostPricingCalculationHookContext
Hook is invoked after the pricing calculation for an item, allowing for adjustments or additional processing based on the calculated price.
| Property name | Type | Description |
|---|---|---|
event | PostPricingCalculationHookContextEvent | Event data for the hook. |
| Method | Description |
|---|---|
setUnitPrice (unitPrice: number, unitPriceFrom: number | null, includesVat: boolean): void | Set the unit price for the item. This will override the existing unit price. |
HookAttribute
| Property name | Type | Description |
|---|---|---|
attributeKey | string | Attribute key |
valueSequence | number | Order for same attribute keys |
boolValue | boolean | null | Boolean value |
textValue | string | Text value |
decimalValue | number | null | Decimal value |
dateTimeValue | Date | null | DateTime value |
guidValue | string | null | Guid value |
HookItemStock
| Property name | Type | Description |
|---|---|---|
warehouse | string | Stock warehouse. |
quantity | number | Stock quantity. |
HookItem
| Property name | Type | Description |
|---|---|---|
itemCode | string | Item code. |
uomCode | string | Unit of measure code. |
familyCode | string | Family code |
vatTariff | 'Normal' | 'Low1' | 'Low2' | 'SuperLow' | 'ParkingTariff' | 'NoVat' | VAT tariff |
attributes | HookAttribute[] | Attributes |
stocks | HookItemStock[] | Stock information |
PostPricingCalculationHookContextEvent
| Property name | Type | Description |
|---|---|---|
item | HookItem | Item being processed in the hook. |
customerCode | string | Customer code for which the pricing is calculated. |
unitPrice | number | Calculated unit price. |
unitPriceFrom | number | null | Calculated unit price from. |
quantity | number | Quantity of the item. |
vatRate | number | VAT rate applied to the item. |
🧩 PreCustomerSyncFinalizeHookContext
Hook is invoked before the finalization of a single customer synchronization, allowing for last-minute adjustments or validations.
| Property name | Type | Description |
|---|---|---|
event | PreCustomerSyncFinalizeHookContextEvent | - |
| Method | Description |
|---|---|
setName (name: string): void | Update the customer name |
setCurrency (currency: string): void | Update the customer currency |
setCocNumber (cocNumber: string): void | Update the chamber of commerce number |
setVatNumber (vatNumber: string): void | Update the VAT number |
setPriceListCode (priceListCode: string): void | Update the price list code |
createOrUpdateAttribute (attributeKey: string, attributeValue: object): void | Create or update a customer attribute |
HookAttribute
| Property name | Type | Description |
|---|---|---|
attributeKey | string | Attribute key |
valueSequence | number | Order for same attribute keys |
boolValue | boolean | null | Boolean value |
textValue | string | Text value |
decimalValue | number | null | Decimal value |
dateTimeValue | Date | null | DateTime value |
guidValue | string | null | Guid value |
HookCustomer
| Property name | Type | Description |
|---|---|---|
customerCode | string | Customer code. |
externalCustomerCode | string | External customer code. |
name | string | Customer name. |
currency | string | Customer currency. |
cocNumber | string | Chamber of Commerce number. |
vatNumber | string | VAT number. |
priceListCode | string | Price list code. |
attributes | HookAttribute[] | Customer attributes. |
PreCustomerSyncFinalizeHookContextEvent
| Property name | Type | Description |
|---|---|---|
customer | HookCustomer | - |
🧩 App4SalesPlatformPreOrderExportHookContext
Hook is invoked before exporting an order to App4Sales platform, allowing for last-minute adjustments.
| Property name | Type | Description |
|---|---|---|
event | HookEvent | Event data for the hook. |
| Method | Description |
|---|---|
setCustomerCode (customCode: string): void | - |
setReference (reference: string): void | - |
setYourReference (yourReference: string): void | - |
setNotes (notes: string): void | - |
setShippingCosts (shippingCosts: number): void | - |
setExternalId (externalId: string): void | - |
setMetadata (key: string, value: object): void | - |
removeLine (index: number): void | - |
setLineItemCode (index: number, itemCode: string): void | - |
setLineQuantity (index: number, quantity: number): void | - |
setLineDiscount (index: number, discount: number | null): void | - |
setLinePrice (index: number, price: number | null): void | - |
setLineInstruction (index: number, instruction: string): void | - |
HookAttribute
| Property name | Type | Description |
|---|---|---|
attributeKey | string | Attribute key |
valueSequence | number | Order for same attribute keys |
boolValue | boolean | null | Boolean value |
textValue | string | Text value |
decimalValue | number | null | Decimal value |
dateTimeValue | Date | null | DateTime value |
guidValue | string | null | Guid value |
HookConnectorOrderLineCreate
| Property name | Type | Description |
|---|---|---|
sequence | number | - |
itemCode | string | - |
quantity | number | - |
unitPrice | number | - |
fromUnitPrice | number | - |
description | string | - |
instruction | string | - |
totalAmount | number | - |
unitOfMeasure | string | - |
vatRate | number | - |
attributes | HookAttribute[] | - |
HookConnectorOrderAddress
| Property name | Type | Description |
|---|---|---|
addressCode | string | - |
type | 'Delivery' | 'Invoice' | 'Other' | 'Custom' | - |
customType | string | - |
street | string | - |
houseNumber | string | - |
houseNumberSuffix | string | - |
city | string | - |
postalCode | string | - |
state | string | - |
countryCode | string | - |
attributes | HookAttribute[] | - |
HookConnectorOrderContact
| Property name | Type | Description |
|---|---|---|
contactCode | string | - |
type | 'PhoneNumber' | 'MobileNumber' | 'Email' | 'Custom' | - |
customType | string | - |
value | string | - |
HookConnectorOrderAttachment
| Property name | Type | Description |
|---|---|---|
attachmentCode | string | - |
type | 'Invoice' | 'DeliveryNote' | 'CreditNote' | 'Custom' | - |
customType | string | - |
fileName | string | - |
contentType | string | - |
fileSize | number | - |
hash | string | - |
createdAt | Date | null | - |
updatedAt | Date | null | - |
HookConnectorOrderCreateSurchargeDto
| Property name | Type | Description |
|---|---|---|
intakeOrderSurchargeId | string | - |
type | 'Shipping' | 'Handling' | 'Payment' | 'Custom' | - |
customType | string | - |
description | string | - |
totalAmount | number | - |
vatRate | number | - |
attributes | HookAttribute[] | - |
HookConnectorOrderCreate
| Property name | Type | Description |
|---|---|---|
intakeOrderId | string | - |
externalId | string | - |
source | string | - |
customerCode | string | - |
currency | string | - |
totalAmount | number | - |
vatIncluded | boolean | null | - |
createdAt | Date | - |
updatedAt | Date | null | - |
notes | string | - |
lines | HookConnectorOrderLineCreate[] | - |
addresses | HookConnectorOrderAddress[] | - |
contacts | HookConnectorOrderContact[] | - |
attachments | HookConnectorOrderAttachment[] | - |
surcharges | HookConnectorOrderCreateSurchargeDto[] | - |
attributes | HookAttribute[] | - |
Line
| Property name | Type | Description |
|---|---|---|
itemCode | string | - |
quantity | number | - |
discount | number | null | - |
price | number | null | - |
instruction | string | - |
HookEventApp4SalesOrderInput
| Property name | Type | Description |
|---|---|---|
customerCode | string | - |
reference | string | - |
yourReference | string | - |
notes | string | - |
shippingCosts | number | - |
lines | Line[] | - |
externalId | string | - |
HookEvent
| Property name | Type | Description |
|---|---|---|
inputOrder | HookConnectorOrderCreate | The order data from the intake order that is being exported to App4SalesPlatform. |
exportOrder | HookEventApp4SalesOrderInput | The order data to be exported to App4SalesPlatform. |
🧩 FortnoxPreOrderExportHookContext
Hook is invoked before exporting an order to Fortnox, allowing for last-minute adjustments.
| Property name | Type | Description |
|---|---|---|
event | HookEvent | Event data for the hook. |
| Method | Description |
|---|---|
setCustomerNumber (customerNumber: string): void | - |
setAdministrationFee (administrationFee: number | null): void | - |
setCurrency (currency: string): void | - |
setOrderDate (orderDate: string): void | - |
setComments (comments: string): void | - |
setYourOrderNumber (yourOrderNumber: string): void | - |
setYourReference (yourReference: string): void | - |
setExternalInvoiceReference1 (reference: string): void | - |
setExternalInvoiceReference2 (reference: string): void | - |
setInvoiceAddress (address1: string, address2: string, zipCode: string, city: string, country: string): void | - |
setDeliveryAddress (address1: string, address2: string, zipCode: string, city: string, country: string, name: string): void | - |
setPhone1 (phoneNumber: string): void | - |
setPhone2 (phoneNumber: string): void | - |
setEmailAddressTo (emailAddress: string): void | - |
setEmailInformation (emailAddressTo: string, emailAddressCc: string, emailAddressBcc: string, emailSubject: string, emailBody: string): void | - |
setFreight (freight: number | null): void | - |
setVatIncluded (vatIncluded: boolean | null): void | - |
setRemarks (remarks: string): void | - |
removeLine (index: number): void | - |
addLine (articleNumber: string, quantity: number, price: number, description: string, discount: number | null, discountType: string, unit: string, vat: number | null): void | - |
setLineArticleNumber (index: number, articleNumber: string): void | - |
setLineAccountNumber (index: number, accountNumber: number | null): void | - |
setLineCostCenter (index: number, costCenter: string): void | - |
setLineQuantity (index: number, quantity: number): void | - |
setLinePrice (index: number, price: number): void | - |
setLineDescription (index: number, description: string): void | - |
setLineDiscount (index: number, discount: number | null, discountType: string): void | - |
setLineUnit (index: number, unit: string): void | - |
setLineVat (index: number, vat: number | null): void | - |
setLineProject (index: number, project: string): void | - |
HookAttribute
| Property name | Type | Description |
|---|---|---|
attributeKey | string | Attribute key |
valueSequence | number | Order for same attribute keys |
boolValue | boolean | null | Boolean value |
textValue | string | Text value |
decimalValue | number | null | Decimal value |
dateTimeValue | Date | null | DateTime value |
guidValue | string | null | Guid value |
HookConnectorOrderLineCreate
| Property name | Type | Description |
|---|---|---|
sequence | number | - |
itemCode | string | - |
quantity | number | - |
unitPrice | number | - |
fromUnitPrice | number | - |
description | string | - |
instruction | string | - |
totalAmount | number | - |
unitOfMeasure | string | - |
vatRate | number | - |
attributes | HookAttribute[] | - |
HookConnectorOrderAddress
| Property name | Type | Description |
|---|---|---|
addressCode | string | - |
type | 'Delivery' | 'Invoice' | 'Other' | 'Custom' | - |
customType | string | - |
street | string | - |
houseNumber | string | - |
houseNumberSuffix | string | - |
city | string | - |
postalCode | string | - |
state | string | - |
countryCode | string | - |
attributes | HookAttribute[] | - |
HookConnectorOrderContact
| Property name | Type | Description |
|---|---|---|
contactCode | string | - |
type | 'PhoneNumber' | 'MobileNumber' | 'Email' | 'Custom' | - |
customType | string | - |
value | string | - |
HookConnectorOrderAttachment
| Property name | Type | Description |
|---|---|---|
attachmentCode | string | - |
type | 'Invoice' | 'DeliveryNote' | 'CreditNote' | 'Custom' | - |
customType | string | - |
fileName | string | - |
contentType | string | - |
fileSize | number | - |
hash | string | - |
createdAt | Date | null | - |
updatedAt | Date | null | - |
HookConnectorOrderCreateSurchargeDto
| Property name | Type | Description |
|---|---|---|
intakeOrderSurchargeId | string | - |
type | 'Shipping' | 'Handling' | 'Payment' | 'Custom' | - |
customType | string | - |
description | string | - |
totalAmount | number | - |
vatRate | number | - |
attributes | HookAttribute[] | - |
HookConnectorOrderCreate
| Property name | Type | Description |
|---|---|---|
intakeOrderId | string | - |
externalId | string | - |
source | string | - |
customerCode | string | - |
currency | string | - |
totalAmount | number | - |
vatIncluded | boolean | null | - |
createdAt | Date | - |
updatedAt | Date | null | - |
notes | string | - |
lines | HookConnectorOrderLineCreate[] | - |
addresses | HookConnectorOrderAddress[] | - |
contacts | HookConnectorOrderContact[] | - |
attachments | HookConnectorOrderAttachment[] | - |
surcharges | HookConnectorOrderCreateSurchargeDto[] | - |
attributes | HookAttribute[] | - |
Line
| Property name | Type | Description |
|---|---|---|
accountNumber | number | null | - |
articleNumber | string | - |
costCenter | string | - |
orderedQuantity | string | - |
price | number | - |
description | string | - |
discount | number | null | - |
discountType | string | - |
unit | string | - |
vAT | number | null | - |
project | string | - |
HookEventFortnoxOrder
| Property name | Type | Description |
|---|---|---|
address1 | string | - |
address2 | string | - |
administrationFee | number | null | - |
city | string | - |
country | string | - |
zipCode | string | - |
customerNumber | string | - |
currency | string | - |
orderDate | string | - |
comments | string | - |
deliveryAddress1 | string | - |
deliveryAddress2 | string | - |
deliveryCity | string | - |
deliveryCountry | string | - |
deliveryName | string | - |
deliveryZipCode | string | - |
emailAddressTo | string | - |
externalInvoiceReference1 | string | - |
externalInvoiceReference2 | string | - |
freight | number | null | - |
phone1 | string | - |
phone2 | string | - |
remarks | string | - |
vATIncluded | boolean | null | - |
yourOrderNumber | string | - |
yourReference | string | - |
orderRows | Line[] | - |
HookEvent
| Property name | Type | Description |
|---|---|---|
inputOrder | HookConnectorOrderCreate | The OCP intake-order data being exported to Fortnox. |
exportOrder | HookEventFortnoxOrder | The order payload to be exported to Fortnox. |