> For the complete documentation index, see [llms.txt](https://shoxl.gitbook.io/vendisto-user-guide/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://shoxl.gitbook.io/vendisto-user-guide/import-and-export/shipping-costs.md).

# Shipping Costs

### Overview

This document serves as a user manual for uploading shipping costs via an Excel file. The data from this Excel file will be processed and imported into a database. The import can be performed partially or fully. In a full import, all records not included in the upload will be removed from the database. Records that fail validation will be highlighted in red, and an error column will be added to the end of the document with corresponding error messages.

### Excel File Structure

The Excel file must adhere to the following structure:

#### Columns

**ShippingCostId (optional)**

* Type: GUID
* Description: If provided, it updates an existing shipping cost record that matches the GUID. If no match is found, a new record is created. \
  When kept empty, a new random guid will be created. No existing record will be updated

**ArticleNumber (required)**

* Type: String
* Description: The article number associated with the shipping cost.

**CountryCode (optional)**

* Type: String (2 or 3 characters)
* Description: Two characters for country codes or three characters if the value is 'ALL'.

**ShipmentCostScenarioType (optional)**

* Type: Enum
* Description: Specifies the shipping cost scenario. The possible values are:
  * NoShippingCosts = 0
  * PostCalculationCosts = 1
  * CustomerThresholdMetFreeShipping = 2
  * Fixed = 3

**PriceListReferences (optional)**

* Type: Object
* Description:&#x20;
  * `PriceListReferences_Name_x` (string, required)

**ShippingCostLabels (optional)**

* Type: Object
* Description:  This object can include the following attributes:
  * `ShippingCostLabels_LanguageId_x` (int, required)
  * `ShippingCostLabels_Label_x` (string, required)

**ShippingCostPrices (optional)**

* Type: Object
* Description: This object can include the following attributes:
  * `ShippingCostPrices_currency_x` (String, 3 characters, required)
  * `ShippingCostPrices_threshold_x` (Decimal, optional)
  * `ShippingCostPrices_priceincluding_x` (Decimal, optional)
  * `ShippingCostPrices_priceexcluding_x` (Decimal, optional)

#### Example Structure

| ShippingCostId                       | ArticleNumber | CountryCode | ShipmentCostScenarioType | PriceListReferences\_Name\_1 | PriceListReferences\_Name\_2 | ShippingCostLabels\_LanguageId\_1 | ShippingCostLabels\_Label\_1 | ShippingCostPrices\_Currency | ShippingCostPrices\_Threshold | ShippingCostPrices\_PriceIncluding | ShippingCostPrices\_PriceExcluding |
| ------------------------------------ | ------------- | ----------- | ------------------------ | ---------------------------- | ---------------------------- | --------------------------------- | ---------------------------- | ---------------------------- | ----------------------------- | ---------------------------------- | ---------------------------------- |
| 123e4567-e89b-12d3-a456-426614174000 | ABC123        | US          | 1                        | List1                        | List2                        | 1                                 | Free Shipping                | USD                          | 100                           | 10                                 | 8                                  |

### Import Process

1. **Uploading the File:**
   * The Excel file is uploaded to the system.
2. **Validation:**
   * The file undergoes validation. Records that fail validation will be highlighted in red.
   * An error column is added to the end of the document containing error messages for each invalid row.
3. **Partial vs. Full Import:**
   * **Partial Import:** Only the records present in the upload are updated or created. Existing records in the database that are not in the upload remain unchanged.
   * **Full Import:** All existing records in the database not included in the upload are deleted.

### Error Handling

* If any records fail validation, they will be highlighted in red in the Excel file.
* An additional column labeled "Errors" will be appended to the file, containing detailed error messages for each invalid record.
* When having at least on error in the document. The whole document will not be processed to the database. It doesn't matter if it is a partial or a full import

### Notes

* Ensure that all required fields are filled correctly.
* Optional fields can be left blank if not applicable.
* Follow the specified formats for each field to avoid validation errors.
