If you are willing to export data for a delivery service that is yet to be supported in OM, you may use a configurator to create a .cvs or .xls file. Once you choose the ''Export'' button in OM, the format of the export file (CSV, Excel), which needs to be constructed, will be selected based on the delivery service label.
1. Configuration steps - creating a connection
Additional settings / Delivery services - select "Custom export"
Fill in the Delivery type, File name, and other possible required data.
Delivery type = select the Delivery type, which was entered beforehand in Settings/Register (selected register - delivery type).
Format = choose the format of the export record
Save your entries.
Click on the ''New entry'' button and select among the following:
Title = column name
Type = value, whose entry you want to convert from order to that column
That needs to be repeated as many times as it is
Save your content.
3. Data export
Select the entered delivery service in Order Management and by clicking on the ''export'' button, the file prepared in the previous steps will be created.
The in-depth description of export configuration
Configuration of settings is composed of the following parts:
- extraFields - general settings of a report
- columns - assigning columns
Configuration example:
{ "type": "MK_EXPORT", "delivery_type_id": 1600372916, "country_id": 1, "default_additional_service_id_list": [], "exportFormat": "XLSX", "additional_delivery_services": [], "extraFields" : { "filename" : "Correos_Spain_", "csv_encoding" : "Cp1250", "csv_separator" : ";" }, "columns": [ , { "title": "OrderNumber", "type": "customer_order", "excelWidth": 200 } , { "title": "Name", "type": "full_name", "excelWidth": 200 } , { "title": "Fix1", "type": "fix_value", "fixValue" : "ES", "excelWidth": 100} , { "title": "Empty1", "type": "empty_value", "excelWidth": 100} ]}
Each column has its own record with the following fields being mandatory:
- title - title, which has to be different for each column
- type - a type of data that determines which data will be printed.
Each column may contain the following fields as well (not necessarily):
- excelWidth - the column width in the Excel table (if the export is done in Excel). Otherwise, the default value is 100.
- stringMaxNOfCharacters - limiting values according to the number of characters.
- replaceCharacter and replaceCharacterSeparator replacement of values according to the entered definition (check Example 2)
- leftPadCharacter in leftPadSize - if the value does not surpass the length of LeftPadSize, LeftPadCharacter characters are added beforehand (check Example 2)
Note: if parameters such as leftPad, replaceCharacter, and stringMaxNOfCharacters are already given, such are always performed in the following sequence:
- replaceCharacter
- leftPad
- stringMaxNOfCharacters
The following types of columns are supported:
Type | Meaning | Note |
fix_value | Fixed value | An additional column 'fixValue' is requested with fixed value. |
fix_value_if_cod | Fixed value, if an order has a purchase price | Additional columns 'fixValue' and 'fixValueNoValue' are requested with fixed values. |
empty_value | Empty value | |
full_name | Receiver's full name | |
firstname | Receiver's name | Only the receiver's full name is entered into OM. ''Name'' is thus the first word, separated by a space. |
secondname | Receiver's surname | Only the receiver's full name is entered into OM. ''Surname'' is thus a string for the first word, separated by a space |
street | Receiver's street and house number | |
street_name | Street | |
street_number | House number | The house number is thus the first string, separated by a space, which contains the number |
post_number | Receiver's ZIP Code | |
place | Receiver's city | |
province | Receiver's province | |
phone_number | Receiver's phone number | |
Receiver's e-mail address | ||
order_date | Order date | Additional column orderDateFormat is requested with an appropriate value for formatting (i.e. "dd/MM/yyyy") |
export_date | Data export date | Additional column orderDateFormat is requested with an appropriate value for formatting (i.e. "dd/MM/yyyy") |
customer_order | Customer's order | |
customer_order_normalize1 | Customer's order in a normalized form | Commas and spaces should be removed. Example "100 200,300400" -> "100200,300400" |
notes | Additional order description | |
cod | The possible value of the purchase price | Through the parameter "codZeroValue" a value is set, used if there is no purchase price (empty value taken). The parameter "codDecimalSeparator" is intended to determine the delimiter between the whole number and the decimal part of the number (taken ","). |
order_sum | Full order's value | |
weight_g | Total weight of an order in grams | |
weight_kg | Total weight of an order in kg (rounded to 3 decimals) | |
productDecription | List of products on the order | list of quantities - product code. Separated by a comma. Contains no services. (i.e. 1 - SKU1, 2 - SKU2) |
product_sku | Product code | Available only if option separate_by_material_product is turned on |
product_quantity | Product quantity | Available only if option separate_by_material_product is turned on |
country_en | Country | |
country_en_2char | Country 2 characters | |
country_en_3char | Country 3 characters | |
product_desc2 | Product Description | |
product_desc3 | Product description separated by a comma | If the option ''Separate the printouts by products'', is selected, it is entered in each row |
product_height | Product height | In mm |
product_width | Product width | In mm |
product_length | Product length | In mm |
street_romania_bl | Street Romania - label BL | |
street_romania_sc | Street Romania - label SC | |
street_romania_et | Street Romania - label ET | |
street_romania_ap | Street Romania - label AP | |
count_code | Order number | |
product_printout_amount_x_code | Products printout (quantity x SKU) | |
product_printout_amount_x_description | Products printout (quantity x description) | Printout format can be selected under 'Additional settings > OrderManagement > Select format of notes on labels' |
product_printout | In case of selecting this option, an additional field ''Printout format'' will be shown. | |
customer_order_and_initials | Customer's order & initials | The customer's order and the first two letters of the name |
tracking_code | Order's tracking code | |
product_customs_tariff | Product's customs tariff | |
product_country_of_origin | Product's country of origin | |
price_with_tax_by_piece | Price with VAT of a product/piece | |
invoice_count_code | Invoice number |
The following general configuration of columns is possible:
Type | Meaning | Default value | Note |
filename | Name of exporting file | not_define | |
csv_encoding | Code table for encoding special characters of the language of the individual country for CSV export | UTF8 | Value example : Cp1250 Cp1252 |
csv_separator | The delimiter between values of columns for CSV export | comma | |
separate_by_material_product | Each order is decomposed into combined order - N rows of material products | empty | |
merge_with_data_export | Merge more exports into one ZIP file. | empty | |
tracking_url | the URL address for tracking the order | empty | The value will be present only in case of a generated tracking code for the sales order: tracking_url + tracking_code |
delivery_service_phone_number | Phone number of the delivery service | empty |
Examples
Example 1: more extensive configuration
{ "type": "MK_EXPORT", "delivery_type_id": 1600372916, "country_id": 1, "default_additional_service_id_list": [], "exportFormat": "XLSX", "additional_delivery_services": [], "extraFields" : { "filename" : "Correos_Spain_", "csv_encoding" : "Cp1250", "csv_separator" : ";" }, "columns": [ { "title": "OrderData", "type": "order_date", "orderDateFormat" : "dd/MM/yyyy", "excelWidth": 200 } , { "title": "OrderNumber", "type": "customer_order", "excelWidth": 200 } , { "title": "Name", "type": "full_name", "excelWidth": 200 } , { "title": "Street", "type": "street", "excelWidth": 200 } , { "title": "Province", "type": "province", "excelWidth": 200 } , { "title": "Post number", "type": "post_number", "excelWidth": 200 } , { "title": "Fix1", "type": "fix_value", "fixValue" : "ES", "excelWidth": 100} , { "title": "Empty1", "type": "empty_value", "excelWidth": 100} , { "title": "Phone", "type": "phone_number_normalize1", "excelWidth": 100} , { "title": "Fix2", "type": "fix_value", "fixValue" : "33", "excelWidth": 100} , { "title": "Empty2", "type": "empty_value", "excelWidth": 100} , { "title": "OrderNumber2", "type": "customer_order_normalize1", "excelWidth": 200, "stringMaxNOfCharacters" : 12} , { "title": "Fix3", "type": "fix_value", "fixValue" : "FALSE", "excelWidth": 100 } , { "title": "Empty3", "type": "empty_value", "excelWidth": 100 } , { "title": "Empty4", "type": "empty_value", "excelWidth": 100 } , { "title": "Notes", "type": "notes", "excelWidth": 200 } , { "title": "Fix4", "type": "fix_value", "fixValue" : "V", "excelWidth": 100 } , { "title": "Fix5", "type": "fix_value", "fixValue" : "1", "excelWidth": 100 } , { "title": "Fix6", "type": "fix_value", "fixValue" : "1", "excelWidth": 100 } , { "title": "Empty5", "type": "empty_value", "excelWidth": 100 } , { "title": "Empty6", "type": "empty_value", "excelWidth": 100 } , { "title": "Empty7", "type": "empty_value", "excelWidth": 100 } , { "title": "Fix7", "type": "fix_value", "fixValue" : "Expedidor", "excelWidth": 100 } , { "title": "COD", "type": "cod", "codZeroValue" : "", "codDecimalSeparator" : ",", "excelWidth": 100 } ]}
Example 2: use of LeftPad and ReplaceCharacter
Notes :
- leftPadSize = 5 in leftPadCharacter = '0' means that if the string is shorter than 5 characters, it will get a character 0 beforehand. i.e. "30" -> "00030"
- replaceCharacterSeparator = "#;". The first character (#) represents the delimiter character between the search string and the string for replacement. The second character(;) represents the delimiter character between individual definitions. Therefore, rule ",# ;!#_;.#" can be decomposed into 3 separate rules according to the character (;) :
- ",# " - change comma to space
- "!#_" - change exclamation mark to underscore
- ".#" - change period to empty string
{ "type" : "MK_EXPORT", "country_id" : 1, "default_additional_service_id_list" : [ ], "extraFields" : { "csv_encoding" : "Cp1252", "csv_separator" : ";", "filename" : "Gologistic_" }, "exportFormat" : "XLSX", "columns" : [ { "title" : "PostalCode", "type" : "post_number", "excelWidth" : 200, "leftPadSize" : 5, "replaceCharacter" : ",# ;!#_;.#", "replaceCharacterSeparator" : "#;", "leftPadCharacter" : "0" } ]}