Skip to content

Create a sale offer

View as Markdown
post /rest/api/sale_offers

Creates a Sale Offer resource.

Creates a sale offer - the selling price of a variant for a country, with a tax and a taxExcludedPrice, valid from startsAt. Attach channels to scope it to specific sales surfaces, and a discountTaxExcludedPrice for a promotion.

Headers

NameTypeRequiredDescription
X-Flowkiwi-Organization-IdstringrequiredThe organization the request acts as. Determines the identity, permissions and ownership applied when reading or modifying data on the instance.

Request body

PropertyTypeRequiredDescription
statusstringrequiredThe status of the offer.
taxExcludedPriceEmbeddedMoneyResource | nullrequiredThe price set for the offer, excluding tax.
Show taxExcludedPrice fields
PropertyTypeRequiredDescription
amountstringrequiredThe monetary amount, as a decimal string.
currencystringrequiredThe ISO 4217 currency code (e.g. EUR).
discountTaxExcludedPriceEmbeddedMoneyResource | null-The discounted tax-excluded price, when a discount applies.
Show discountTaxExcludedPrice fields
PropertyTypeRequiredDescription
amountstringrequiredThe monetary amount, as a decimal string.
currencystringrequiredThe ISO 4217 currency code (e.g. EUR).
startsAtstring | null-Start date of the offer. Defaults to the current date/time if not provided.
endsAtstring | null-End date of the offer.
countrystring | nullrequiredThe country resource it belongs to.
taxstring | nullrequiredThe tax resource it belongs to.
variantstring | nullrequiredThe variant resource it belongs to.
channelsstring[]-A list of Channel IRIs the sale offer is distributed through.

Response

201 - Sale Offer resource created

PropertyTypeRequiredDescription
@contextobject-
@idstringrequired
@typestringrequired
idstring-The unique identifier of the sale offer.
statusstring-The status of the offer.
taxExcludedPriceEmbeddedMoneyResourcerequiredThe price set for the offer, excluding tax.
Show taxExcludedPrice fields
PropertyTypeRequiredDescription
amountstringrequiredThe monetary amount, as a decimal string.
currencystringrequiredThe ISO 4217 currency code (e.g. EUR).
taxExcludedPricePerUnitEmbeddedPricePerUnitResource | null-The tax-excluded price expressed per measurement reference unit.
Show taxExcludedPricePerUnit fields
PropertyTypeRequiredDescription
amountstringrequiredThe monetary amount, as a decimal string.
currencystringrequiredThe ISO 4217 currency code (e.g. EUR).
unit"ml" | "cl" | "l" | "mg" | "g" | "kg" | "mm" | "cm" | "m" | "m2" | "unit"requiredThe reference unit the amount is expressed per.
valueintegerrequiredThe number of reference units the amount applies to.
priceEmbeddedMoneyResource-The tax-included price, computed from taxExcludedPrice and the referenced Tax rate.
Show price fields
PropertyTypeRequiredDescription
amountstringrequiredThe monetary amount, as a decimal string.
currencystringrequiredThe ISO 4217 currency code (e.g. EUR).
pricePerUnitEmbeddedPricePerUnitResource | null-The tax-included price expressed per measurement reference unit.
Show pricePerUnit fields
PropertyTypeRequiredDescription
amountstringrequiredThe monetary amount, as a decimal string.
currencystringrequiredThe ISO 4217 currency code (e.g. EUR).
unit"ml" | "cl" | "l" | "mg" | "g" | "kg" | "mm" | "cm" | "m" | "m2" | "unit"requiredThe reference unit the amount is expressed per.
valueintegerrequiredThe number of reference units the amount applies to.
discountPriceEmbeddedMoneyResource | null-The discounted tax-included price, when a discount applies.
Show discountPrice fields
PropertyTypeRequiredDescription
amountstringrequiredThe monetary amount, as a decimal string.
currencystringrequiredThe ISO 4217 currency code (e.g. EUR).
discountPricePerUnitEmbeddedPricePerUnitResource | null-The discounted tax-included price per measurement reference unit, when a discount applies.
Show discountPricePerUnit fields
PropertyTypeRequiredDescription
amountstringrequiredThe monetary amount, as a decimal string.
currencystringrequiredThe ISO 4217 currency code (e.g. EUR).
unit"ml" | "cl" | "l" | "mg" | "g" | "kg" | "mm" | "cm" | "m" | "m2" | "unit"requiredThe reference unit the amount is expressed per.
valueintegerrequiredThe number of reference units the amount applies to.
discountTaxExcludedPriceEmbeddedMoneyResource | null-The discounted tax-excluded price, when a discount applies.
Show discountTaxExcludedPrice fields
PropertyTypeRequiredDescription
amountstringrequiredThe monetary amount, as a decimal string.
currencystringrequiredThe ISO 4217 currency code (e.g. EUR).
discountTaxExcludedPricePerUnitEmbeddedPricePerUnitResource | null-The discounted tax-excluded price per measurement reference unit, when a discount applies.
Show discountTaxExcludedPricePerUnit fields
PropertyTypeRequiredDescription
amountstringrequiredThe monetary amount, as a decimal string.
currencystringrequiredThe ISO 4217 currency code (e.g. EUR).
unit"ml" | "cl" | "l" | "mg" | "g" | "kg" | "mm" | "cm" | "m" | "m2" | "unit"requiredThe reference unit the amount is expressed per.
valueintegerrequiredThe number of reference units the amount applies to.
startsAtstring-Start date of the offer. Defaults to the current date/time if not provided.
endsAtstring | null-End date of the offer.
countrystringrequiredThe country resource it belongs to.
taxstringrequiredThe tax resource it belongs to.
variantstringrequiredThe variant resource it belongs to.
channelsstring[]-A list of Channel IRIs the sale offer is distributed through.
createdAtstring-The date and time when the resource was created (ISO 8601 format).
updatedAtstring-The date and time when the resource was last modified (ISO 8601 format).

Errors

400 - Invalid input

PropertyTypeRequiredDescription
@contextobject-
@idstringrequired
@typestringrequired
titlestring | null-A short, human-readable summary of the problem.
detailstring | null-A human-readable explanation specific to this occurrence of the problem.
statusnumber | null-
instancestring | null-A URI reference that identifies the specific occurrence of the problem. It may or may not yield further information if dereferenced.
typestring-A URI reference that identifies the problem type

403 - Access denied. The caller is missing one or more identity permissions required for this operation.

Content-Type: application/problem+json

PropertyTypeRequiredDescription
@contextobject-
@idstringrequired
@typestringrequired
typestring-
titlestring-
statusinteger-
detailstring-
missingPermissionsstring[]-Identity permissions that the caller is missing for this operation. Present only when the 403 is caused by a denied identity:* permission.

422 - An error occurred

PropertyTypeRequiredDescription
@contextobject-
@idstringrequired
@typestringrequired
statusinteger-
violationsobject[]-
Show violations fields
PropertyTypeRequiredDescription
propertyPathstringrequiredThe property path of the violation
messagestringrequiredThe message associated with the violation
codestring-The code of the violation
hintstring-An extra hint to understand the violation
payloadobject-The serialized payload of the violation
detailstring-
typestring-
titlestring | null-
instancestring | null-