# Import Resources Representations of resources that can be imported into a Project using the Import API. Import Resources are almost identical to the equivalent type on the HTTP API, with the main difference that `id` values are not included. When referencing other resources, such as defining the `parent` of a [CategoryImport](/api/import-export/import-resources.md#categoryimport), only [KeyReferences](/api/types.md#keyreference) are accepted. This ensures that resources can be imported to multiple Projects, such as production and staging, without needing to change Project-specific `id` values. Types that are identical on the HTTP API, we do not document here, but refer to the respective type on the HTTP API instead. ## for Business Units Business Units are represented as either Companies or Divisions. ### CompanyBusinessUnitImport [type definition](/api/import-export/import-resources.md?urn=ctp:import:type:CompanyBusinessUnitImport). ### DivisionBusinessUnitImport [type definition](/api/import-export/import-resources.md?urn=ctp:import:type:DivisionBusinessUnitImport). #### AssociateDraft [type definition](/api/import-export/import-resources.md?urn=ctp:import:type:AssociateDraft). #### AssociateRoleAssignmentDraft [type definition](/api/import-export/import-resources.md?urn=ctp:import:type:AssociateRoleAssignmentDraft). ## for Categories ### CategoryImport [type definition](/api/import-export/import-resources.md?urn=ctp:import:type:CategoryImport). ## for Customers ### CustomerImport [type definition](/api/import-export/import-resources.md?urn=ctp:import:type:CustomerImport). #### CustomerAddress [type definition](/api/import-export/import-resources.md?urn=ctp:import:type:CustomerAddress). ## for Discount Codes ### DiscountCodeImport [type definition](/api/import-export/import-resources.md?urn=ctp:import:type:DiscountCodeImport). ## for Inventory ### InventoryImport [type definition](/api/import-export/import-resources.md?urn=ctp:import:type:InventoryImport). ## for Product Types ### ProductTypeImport [type definition](/api/import-export/import-resources.md?urn=ctp:import:type:ProductTypeImport). ## for Products When updating existing Products by import, you must include the existing values of the Product. The import process will remove the values of omitted fields. ### ProductImport [type definition](/api/import-export/import-resources.md?urn=ctp:import:type:ProductImport). ### ProductDraftImport [type definition](/api/import-export/import-resources.md?urn=ctp:import:type:ProductDraftImport). #### ProductVariantDraftImport [type definition](/api/import-export/import-resources.md?urn=ctp:import:type:ProductVariantDraftImport). #### EmbeddedPriceDraftImport [type definition](/api/import-export/import-resources.md?urn=ctp:import:type:PriceDraftImport). ## for Product Variants When updating an existing Product Variant by import, you must include the existing values of all fields in [ProductVariantImport](/api/import-export/import-resources.md#productvariantimport). The import process will remove the values of omitted fields. ### ProductVariantImport [type definition](/api/import-export/import-resources.md?urn=ctp:import:type:ProductVariantImport). #### Attribute Represents the [Attribute](/urn?urn=ctp%3Aapi%3Atype%3AAttribute) value to be persisted in a Product Variant. - `name` - String - Optional Required if used for [ProductVariantImport](/api/import-export/import-resources.md#productvariantimport). Must not be set when used for [ProductVariantPatch](/api/import-export/import-resources.md#productvariantpatch). Must match `name` of an [AttributeDefinition](/urn?urn=ctp%3Aapi%3Atype%3AAttributeDefinition) of the [ProductType](/urn?urn=ctp%3Aapi%3Atype%3AProductType). - `type` - String - Optional Required if used for [ProductVariantImport](/api/import-export/import-resources.md#productvariantimport). Must not be set when used for [ProductVariantPatch](/api/import-export/import-resources.md#productvariantpatch). Must match `type` of an [AttributeDefinition](/urn?urn=ctp%3Aapi%3Atype%3AAttributeDefinition) of the [ProductType](/urn?urn=ctp%3Aapi%3Atype%3AProductType). - `value` - Required The actual value of the Attribute compliant to the `type`, see specific Attribute types in this section. When importing [nested Attributes](/api/projects/productTypes.md#attributenestedtype) , do not include the `type` field, and `value` should be an array of Attributes. For more information about nested Attributes, see the [Nested Attribute type](/learning-model-your-product-catalog/attribute-types-and-attribute-groups/nested-attribute-type.md) learning page. You can import Products with nested Attributes by using a [ProductDraftImport](/api/import-export/import-resources.md#productdraftimport) or a [ProductVariantImport](/api/import-export/import-resources.md#productvariantimport). ```json { "type": "product-draft", "resources": [ { "key": "example-t-shirt", "name": { "en": "example-t-shirt" }, "slug": { "en": "example-t-shirt" }, "productType": { "typeId": "product-type", "key": "t-shirt-product-type" }, "masterVariant": { "key": "example-t-shirt-variant1", "attributes": [ { "name": "fit", "value": "regular" }, { "name": "fabricComposition", "value": [ [ { "name": "percentage", "value": 80 }, { "name": "materialName", "value": "COTTON" } ], [ { "name": "percentage", "value": 20 }, { "name": "materialName", "value": "POLYESTER" } ] ] } ] } } ] } ``` ```json { "type": "product-variant", "resources": [ { "key": "example-t-shirt-variant1", "sku": "example-t-shirt-variant1", "product": { "key": "example-t-shirt", "typeId": "product" }, "isMasterVariant": true, "attributes": [ { "name": "fit", "value": "regular" }, { "name": "fabricComposition", "value": [ [ { "name": "percentage", "value": 80 }, { "name": "materialName", "value": "COTTON" } ], [ { "name": "percentage", "value": 15 }, { "name": "materialName", "value": "POLYESTER" } ], [ { "name": "percentage", "value": 5 }, { "name": "materialName", "value": "ELASTANE" } ] ] } ] } ] } ``` ##### BooleanAttribute [type definition](/api/import-export/import-resources.md?urn=ctp:import:type:BooleanAttribute). ##### BooleanSetAttribute [type definition](/api/import-export/import-resources.md?urn=ctp:import:type:BooleanSetAttribute). ##### DateAttribute [type definition](/api/import-export/import-resources.md?urn=ctp:import:type:DateAttribute). ##### DateSetAttribute [type definition](/api/import-export/import-resources.md?urn=ctp:import:type:DateSetAttribute). ##### DateTimeAttribute [type definition](/api/import-export/import-resources.md?urn=ctp:import:type:DateTimeAttribute). ##### DateTimeSetAttribute [type definition](/api/import-export/import-resources.md?urn=ctp:import:type:DateTimeSetAttribute). ##### EnumAttribute [type definition](/api/import-export/import-resources.md?urn=ctp:import:type:EnumAttribute). ##### EnumSetAttribute [type definition](/api/import-export/import-resources.md?urn=ctp:import:type:EnumSetAttribute). ##### LocalizableEnumAttribute [type definition](/api/import-export/import-resources.md?urn=ctp:import:type:LocalizableEnumAttribute). ##### LocalizableEnumSetAttribute [type definition](/api/import-export/import-resources.md?urn=ctp:import:type:LocalizableEnumSetAttribute). ##### LocalizableTextAttribute [type definition](/api/import-export/import-resources.md?urn=ctp:import:type:LocalizableTextAttribute). ##### LocalizableTextSetAttribute [type definition](/api/import-export/import-resources.md?urn=ctp:import:type:LocalizableTextSetAttribute). ##### MoneyAttribute [type definition](/api/import-export/import-resources.md?urn=ctp:import:type:MoneyAttribute). ##### MoneySetAttribute [type definition](/api/import-export/import-resources.md?urn=ctp:import:type:MoneySetAttribute). ##### NumberAttribute [type definition](/api/import-export/import-resources.md?urn=ctp:import:type:NumberAttribute). ##### NumberSetAttribute [type definition](/api/import-export/import-resources.md?urn=ctp:import:type:NumberSetAttribute). ##### ReferenceAttribute [type definition](/api/import-export/import-resources.md?urn=ctp:import:type:ReferenceAttribute). ##### ReferenceSetAttribute [type definition](/api/import-export/import-resources.md?urn=ctp:import:type:ReferenceSetAttribute). ##### TextAttribute [type definition](/api/import-export/import-resources.md?urn=ctp:import:type:TextAttribute). ##### TextSetAttribute [type definition](/api/import-export/import-resources.md?urn=ctp:import:type:TextSetAttribute). ##### TimeAttribute [type definition](/api/import-export/import-resources.md?urn=ctp:import:type:TimeAttribute). ##### TimeSetAttribute [type definition](/api/import-export/import-resources.md?urn=ctp:import:type:TimeSetAttribute). ### ProductVariantPatch [type definition](/api/import-export/import-resources.md?urn=ctp:import:type:ProductVariantPatch). ## for Variants This import resource is only available for Projects with `productCatalogModel` set to `Modular`. ### VariantImport [type definition](/api/import-export/import-resources.md?urn=ctp:import:type:VariantImport). ## for Product Selections ### ProductSelectionImport [type definition](/api/import-export/import-resources.md?urn=ctp:import:type:ProductSelectionImport). #### ProductSelectionAssignment [type definition](/api/import-export/import-resources.md?urn=ctp:import:type:ProductSelectionAssignment). ##### VariantSelectionType [type definition](/api/import-export/import-resources.md?urn=ctp:import:type:VariantSelectionType). ## for Product Tailoring ### ProductTailoringImport [type definition](/api/import-export/import-resources.md?urn=ctp:import:type:ProductTailoringImport). #### ProductVariantTailoringImport [type definition](/api/import-export/import-resources.md?urn=ctp:import:type:ProductVariantTailoringImport). ## for Prices ### EmbeddedPriceImport [type definition](/api/import-export/import-resources.md?urn=ctp:import:type:PriceImport). ### StandalonePriceImport When updating an existing StandalonePrice by import, you must include the existing values of all fields in [StandalonePriceImport](/api/import-export/import-resources.md#standalonepriceimport). The import process will remove the values of omitted fields. [type definition](/api/import-export/import-resources.md?urn=ctp:import:type:StandalonePriceImport). ## for Orders ### OrderImport [type definition](/api/import-export/import-resources.md?urn=ctp:import:type:OrderImport). #### LineItemImportDraft [type definition](/api/import-export/import-resources.md?urn=ctp:import:type:LineItemImportDraft). #### CustomLineItemDraft [type definition](/api/import-export/import-resources.md?urn=ctp:import:type:CustomLineItemDraft). ##### LineItemProductVariantImportDraft [type definition](/api/import-export/import-resources.md?urn=ctp:import:type:LineItemProductVariantImportDraft). ##### LineItemPrice [type definition](/api/import-export/import-resources.md?urn=ctp:import:type:LineItemPrice). ##### DiscountedPrice [type definition](/api/import-export/import-resources.md?urn=ctp:import:type:DiscountedPrice). ##### DiscountedLineItemPriceDraft [type definition](/api/import-export/import-resources.md?urn=ctp:import:type:DiscountedLineItemPriceDraft). #### ShippingInfoImportDraft [type definition](/api/import-export/import-resources.md?urn=ctp:import:type:ShippingInfoImportDraft). ### OrderPatchImport [type definition](/api/import-export/import-resources.md?urn=ctp:import:type:OrderPatchImport). #### OrderField [type definition](/api/import-export/import-resources.md?urn=ctp:import:type:OrderField). ##### ReturnInfo [type definition](/api/import-export/import-resources.md?urn=ctp:import:type:ReturnInfo). ##### DeliveryParcel [type definition](/api/import-export/import-resources.md?urn=ctp:import:type:DeliveryParcel). ##### DeliveryItem [type definition](/api/import-export/import-resources.md?urn=ctp:import:type:DeliveryItem). ##### DeliveryDraft [type definition](/api/import-export/import-resources.md?urn=ctp:import:type:DeliveryDraft). ##### DeliveryParcelDraft [type definition](/api/import-export/import-resources.md?urn=ctp:import:type:DeliveryParcelDraft). ##### DeliveryAddressDraft [type definition](/api/import-export/import-resources.md?urn=ctp:import:type:DeliveryAddressDraft). ##### ParcelMeasurement [type definition](/api/import-export/import-resources.md?urn=ctp:import:type:ParcelMeasurements). ##### ParcelMeasurementDraft [type definition](/api/import-export/import-resources.md?urn=ctp:import:type:ParcelMeasurementDraft). ##### ParcelTrackingData [type definition](/api/import-export/import-resources.md?urn=ctp:import:type:ParcelTrackingData). ##### TrackingData [type definition](/api/import-export/import-resources.md?urn=ctp:import:type:TrackingData). ##### ParcelItems [type definition](/api/import-export/import-resources.md?urn=ctp:import:type:ParcelItems). ##### RemoveDeliveryDraft [type definition](/api/import-export/import-resources.md?urn=ctp:import:type:RemoveDeliveryDraft). ##### RemoveParcelFromDeliveryDraft [type definition](/api/import-export/import-resources.md?urn=ctp:import:type:RemoveParcelFromDeliveryDraft). ## for Custom Types ### TypeImport [type definition](/api/import-export/import-resources.md?urn=ctp:import:type:TypeImport). #### ResourceTypeId [type definition](/api/import-export/import-resources.md?urn=ctp:import:type:ResourceTypeId). #### FieldDefinition [type definition](/api/import-export/import-resources.md?urn=ctp:import:type:FieldDefinition). #### TypeTextInputHint [type definition](/api/import-export/import-resources.md?urn=ctp:import:type:TypeTextInputHint). ## common to Import Resources ### Custom Fields The value representations of Custom Fields defined on Import Resources. #### Custom [type definition](/api/import-export/import-resources.md?urn=ctp:import:type:Custom). #### FieldContainer JSON object containing key-value pairs with - key being the `name` of the Custom Field as defined in the respective [FieldDefinition](/urn?urn=ctp%3Aapi%3Atype%3AFieldDefinition) - value - [CustomField](/api/import-export/import-resources.md#customfield) ```json title="Example FieldContainer with three Custom Fields of different FieldTypes" { "example-boolean-field": { "type": "Boolean", "value": true }, "example-localized-string-field": { "type": "LocalizedString", "value": { "en": "English text", "es": "texto en español" } }, "example-datetime-field": { "type": "DateTime", "value": "2018-10-14T14:00:00.000Z" } } ``` #### CustomField JSON object with two fields: - `type`: The `name` of the corresponding [FieldType](/urn?urn=ctp%3Aapi%3Atype%3AFieldType). - `value`: The actual value of the Custom Field compliant to the `type`, see specific types in this section. ##### BooleanField [type definition](/api/import-export/import-resources.md?urn=ctp:import:type:BooleanField). ##### StringField [type definition](/api/import-export/import-resources.md?urn=ctp:import:type:StringField). ```json "example-string-field": { "type": "String", "value": "Some String value" } ``` ##### LocalizedStringField [type definition](/api/import-export/import-resources.md?urn=ctp:import:type:LocalizedStringField). ```json "example-localized-string-field": { "type": "LocalizedString", "value": { "en": "English text", "es": "texto en español" } } ``` ##### EnumField [type definition](/api/import-export/import-resources.md?urn=ctp:import:type:EnumField). ```json "example-enum-field": { "type": "Enum", "value": "key-of-the-enum-value" } ``` ##### LocalizedEnumField [type definition](/api/import-export/import-resources.md?urn=ctp:import:type:LocalizedEnumField). ```json "example-localized-enum-field": { "type": "LocalizedEnum", "value": "key-of-the-localized-enum-value" } ``` ##### NumberField [type definition](/api/import-export/import-resources.md?urn=ctp:import:type:NumberField). ```json "example-number-field": { "type": "Number", "value": 123 } ``` ##### MoneyField [type definition](/api/import-export/import-resources.md?urn=ctp:import:type:MoneyField). ```json "example-money-field": { "type": "Money", "value": { "type": "centPrecision", "currencyCode": "USD", "centAmount": 124500, "fractionDigits": 2 } } ``` ##### DateField [type definition](/api/import-export/import-resources.md?urn=ctp:import:type:DateField). ```json "example-date-field": { "type": "Date", "value": "2001-10-12" } ``` ##### TimeField [type definition](/api/import-export/import-resources.md?urn=ctp:import:type:TimeField). ```json "example-time-field": { "type": "Time", "value": "14:00:00.000" } ``` ##### DateTimeField [type definition](/api/import-export/import-resources.md?urn=ctp:import:type:DateTimeField). ```json "example-datetime-field": { "type": "DateTime", "value": "2018-10-14T14:00:00.000Z" } ``` ##### ReferenceField [type definition](/api/import-export/import-resources.md?urn=ctp:import:type:ReferenceField). ```json "example-reference-field": { "type": "Reference", "value": { "typeId": "product", "key": "key-of-a-product" } } ``` ##### BooleanSetField [type definition](/api/import-export/import-resources.md?urn=ctp:import:type:BooleanSetField). ```json "example-set-of-boolean-field": { "type": "BooleanSet", "value": [true, false, true] } ``` ##### StringSetField [type definition](/api/import-export/import-resources.md?urn=ctp:import:type:StringSetField). ```json "example-set-of-string-field": { "type": "StringSet", "value": ["Some String value 1", "Some String value 2"] } ``` ##### LocalizedStringSetField [type definition](/api/import-export/import-resources.md?urn=ctp:import:type:LocalizedStringSetField). ```json "example-set-of-localized-string-field": { "type": "LocalizedStringSet", "value": [ { "en": "English text 1", "es": "texto en español 1" }, { "en": "English text 2", "es": "texto en español 2" } ] } ``` ##### EnumSetField [type definition](/api/import-export/import-resources.md?urn=ctp:import:type:EnumSetField). ```json "example-set-of-enum-field": { "type": "Enum", "value": ["key-of-enum-value-1", "key-of-enum-value-2", "key-of-enum-value-3"] } ``` ##### LocalizedEnumSetField [type definition](/api/import-export/import-resources.md?urn=ctp:import:type:LocalizedEnumSetField). ```json "example-set-of-localized-enum-field": { "type": "Enum", "value": ["key-of-localized-enum-value-1", "key-of-localized-enum-value-2"] } ``` ##### NumberSetField [type definition](/api/import-export/import-resources.md?urn=ctp:import:type:NumberSetField). ```json "example-set-of-number-field": { "type": "NumberSet", "value": [123, 456] } ``` ##### MoneySetField [type definition](/api/import-export/import-resources.md?urn=ctp:import:type:MoneySetField). ```json "example-set-of-money-field": { "type": "MoneySet", "value": [ { "type": "centPrecision", "currencyCode": "USD", "centAmount": 124500, "fractionDigits": 2 }, { "type": "centPrecision", "currencyCode": "USD", "centAmount": 1000, "fractionDigits": 2 } ] } ``` ##### DateSetField [type definition](/api/import-export/import-resources.md?urn=ctp:import:type:DateSetField). ```json "example-set-of-date-field": { "type": "DateSet", "value": ["2001-10-12", "2001-10-13"] } ``` ##### TimeSetField [type definition](/api/import-export/import-resources.md?urn=ctp:import:type:TimeSetField). ```json "example-set-of-time-field": { "type": "TimeSet", "value": ["14:00:00.000", "15:00:00.000"] } ``` ##### DateTimeSetField [type definition](/api/import-export/import-resources.md?urn=ctp:import:type:DateTimeSetField). ```json "example-set-of-datetime-field": { "type": "DateTimeSet", "value": ["2018-10-14T14:00:00.000Z", "2018-10-14T15:00:00.000Z"] } ``` ##### ReferenceSetField [type definition](/api/import-export/import-resources.md?urn=ctp:import:type:ReferenceSetField). ```json "example-set-of-reference-field": { "type": "ReferenceSet", "value": [ { "typeId": "product", "key": "key-of-a-product" }, { "typeId": "product", "key": "key-of-a-product" } ] } ``` ### References #### KeyReference [type definition](/api/import-export/import-resources.md?urn=ctp:import:type:KeyReference). #### ReferenceType [type definition](/api/import-export/import-resources.md?urn=ctp:import:type:ReferenceType). ## Related pages - [Area overview page with navigation](/api.md) - [Previous page: Import Requests](/api/import-export/import-requests.md) - [Next page: Import Operations](/api/import-export/import-operation.md)