BETA

Importing Prices

This endpoint can be used to import Price data to create and update EmbeddedPrices in a commercetools Project. The Price data to import is represented by PriceImport and loaded in PriceImportRequest, which is posted to import Prices.

To monitor an import status, use Get ImportSummary, Get ImportOperation, and Query ImportOperations.

Representations

PriceImportRequest

The request body to import Prices. Contains data for EmbeddedPrices to be created or updated in a commercetools Project.

type
String
"price"

The price import resource type.

resources
Array of PriceImport

The price import resources of this request.

MaxItems: 20
Example: json
{
"type" : "price",
"resources" : [ {
"key" : "bigPriceKeyTestCat",
"country" : "DE",
"validFrom" : "2021-04-11T14:00:00.000Z",
"validUntil" : "2022-04-11T14:00:00.000Z",
"customerGroup" : {
"typeId" : "customer-group",
"key" : "customer-group-key"
},
"channel" : {
"typeId" : "channel",
"key" : "channel-key"
},
"discounted" : {
"value" : {
"type" : "centPrecision",
"currencyCode" : "EUR",
"centAmount" : 251
},
"discount" : {
"typeId" : "product-discount",
"key" : "product-discount-key"
}
},
"tiers" : [ {
"minimumQuantity" : 5,
"value" : {
"type" : "centPrecision",
"currencyCode" : "EUR",
"centAmount" : 80
}
} ],
"productVariant" : {
"typeId" : "product-variant",
"key" : "red-t-shirt"
},
"product" : {
"typeId" : "product",
"key" : "t-shirt"
},
"value" : {
"type" : "centPrecision",
"currencyCode" : "EUR",
"centAmount" : 300
},
"custom" : {
"type" : {
"typeId" : "type",
"key" : "custom-type"
},
"fields" : {
"customFieldName" : {
"type" : "String",
"value" : "customFieldValue"
}
}
}
}, {
"key" : "bigPriceKeyTestCat",
"country" : "DE",
"validFrom" : "2021-04-11T14:00:00.000Z",
"validUntil" : "2022-04-11T14:00:00.000Z",
"discounted" : {
"value" : {
"type" : "highPrecision",
"fractionDigits" : 3,
"preciseAmount" : 2513,
"currencyCode" : "EUR",
"centAmount" : 1234
},
"discount" : {
"typeId" : "product-discount",
"key" : "product-discount-key"
}
},
"tiers" : [ {
"minimumQuantity" : 5,
"value" : {
"type" : "centPrecision",
"currencyCode" : "EUR",
"centAmount" : 80
}
} ],
"productVariant" : {
"typeId" : "product-variant",
"key" : "red-t-shirt"
},
"product" : {
"typeId" : "product",
"key" : "t-shirt"
},
"value" : {
"type" : "centPrecision",
"currencyCode" : "EUR",
"centAmount" : 300
}
} ]
}

PriceImport

The data representation for a price to be imported that is persisted as an EmbeddedPrice in the Project.

key
String
value

Maps to Price.value.

country
CountryCode

Maps to Price.county.

Pattern: ^[A-Z]{2}$
validFrom

Maps to Price.validFrom.

validUntil

Maps to Price.validUntil.

customerGroup

The Reference to the CustomerGroup with which the EmbeddedPrice is associated. If referenced CustomerGroup does not exist, the state of the ImportOperation will be set to unresolved until the necessary CustomerGroup is created.

channel

The Reference to the Channel with which the EmbeddedPrice is associated. If referenced Channel does not exist, the state of the ImportOperation will be set to unresolved until the necessary Channel is created.

discounted
DiscountedPrice

Sets a discounted price from an external service.

publish
Boolean

Only the EmbeddedPrice updates will be published to staged and current projection.

Default: false
tiers
Array of PriceTier

The tiered prices for this price.

productVariant

The ProductVariant in which this EmbeddedPrice is contained. The Reference to the ProductVariant with which the EmbeddedPrice is associated. If referenced ProductVariant does not exist, the state of the ImportOperation will be set to unresolved until the necessary ProductVariant is created.

product

The Product in which the Product Variant containing this EmbeddedPrice is contained. Maps to ProductVariant.product. The Reference to the Product with which the EmbeddedPrice is associated. If referenced Product does not exist, the state of the ImportOperation will be set to unresolved until the necessary Product is created.

custom

The custom fields for this price.

Import Prices

Creates a request for creating new Prices or updating existing ones.

POST
https://import.{region}.commercetools.com/{projectKey}/prices/import-containers/{importContainerKey}
OAuth 2.0 Scopes:
manage_products:{projectKey}
Path parameters:
region
String

The Region in which the Project is hosted.

projectKey
String

The commercetools Project key.

importContainerKey
String

The ImportContainer used to create the new resource

Request Body:PriceImportRequest
Response:

201ImportResponse

Developer Center
HTTP APIGraphQL APIPlatform Release NotesCustom ApplicationsBETASDKs & Client LibrariesImport & ExportSUNRISE Starter FrontendsTutorialsFAQ
Merchant Center
DocumentationRelease Notes
Sign upLog inTech BlogIntegrationsStatusSupportUser Research Program
Copyright © 2022 commercetools
Privacy PolicyImprint