This is the early access documentation preview for Custom Views. This documentation might not be in sync with our official documentation.

Importing Standalone Prices

Create and update Standalone Prices in your Project.

The Standalone Price data to import is represented by StandalonePriceImport and included in a StandalonePriceImportRequest, which is imported using Import Standalone Prices.

Standalone Prices are different to Embedded Prices, which store their prices within the Product Variant or Line Item. You should check what type of price you are importing to ensure you are using the correct endpoint.

Representations

StandalonePriceImportRequest

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

type
String
"standalone-price"

The Standalone Price import resource type.

resources

The Standalone Price import resources of this request.

MaxItems: 20

StandalonePriceImport

The data representation for a Standalone Price to be imported that is persisted as a Standalone Price in the Project.

key
String

User-defined unique identifier for the Standalone Price. If a StandalonePrice with this key exists, it will be updated with the imported data.

MinLength: 2MaxLength: 256Pattern: ^[A-Za-z0-9_-]+$
sku
String

Identifies the ProductVariant to which this Standalone Price is associated. This value is not validated to exist in Product Variants.

value

Sets the money value of this Price.

country
CountryCode

Sets the country for which this Price is valid.

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

Sets the CustomerGroup for which this Price is valid.

channel

Sets the product distribution Channel for which this Price is valid

validFrom

Sets the date from which the Price is valid.

validUntil

Sets the date until the Price is valid.

tiers
Array of PriceTier

Sets price tiers.

discounted
DiscountedPrice

Sets a discounted price for this Price that is different from the base price with value.

custom

Custom Fields for the StandalonePrice.

Import Standalone Prices

POST
https://import.{region}.commercetools.com/{projectKey}/standalone-prices/import-containers/{importContainerKey}

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

OAuth 2.0 Scopes:
manage_standalone_prices:{projectKey} , view_standalone_prices:{projectKey}
Path parameters:
region
String

The Region in which the Project is hosted.

projectKey
String

The Project key.

importContainerKey
String

The ImportContainer used to create the new resource

Request Body:StandalonePriceImportRequestasapplication/json
Response:
201ImportResponseasapplication/json
Request Example:cURL
curl https://import.{region}.commercetools.com/{projectKey}/standalone-prices/import-containers/{importContainerKey} -i \
--header 'Authorization: Bearer ${BEARER_TOKEN}' \
--header 'Content-Type: application/json' \
--data-binary @- << DATA
{
"type" : "standalone-price",
"resources" : [ {
"key" : "priceKey",
"sku" : "variantSku",
"value" : {
"type" : "centPrecision",
"currencyCode" : "EUR",
"centAmount" : 100
}
} ]
}
DATA