Primary navigation

Promotions

Retrieve and upsert promotions for a feed.

Overview

Use these endpoints to retrieve the current promotions for a feed or upsert partial promotion changes matched by id.

REST endpoints

  • GET /product_feeds/{id}/promotions returns the promotions for the specified feed.
  • PATCH /product_feeds/{id}/promotions upserts promotions into the specified feed. Promotions are matched by id, and promotions not included in the request remain unchanged.

GET /product_feeds/{id}/promotions

Returns the promotions for the specified feed.

Path parameters

FieldTypeRequiredDescription
idstringYesIdentifier for the feed.

Request

This endpoint does not define a request body.

Response

200 OK

FieldTypeRequiredDescription
[]Promotion[]YesArray of promotions for the specified feed.

404 Not Found

Returned when the feed is not found.

PATCH /product_feeds/{id}/promotions

Upserts promotions into the specified feed. Promotions are matched by id. Promotions not included in the request remain unchanged.

Path parameters

FieldTypeRequiredDescription
idstringYesIdentifier for the feed.

Request

FieldTypeRequiredDescription
[]Promotion[]YesArray of promotions for the feed.

Response

200 OK

Returns the following acceptance object:

FieldTypeRequiredDescription
idstringYesIdentifier for the feed.
acceptedbooleanYesWhether the promotion payload was accepted.

400 Bad Request

Returned when the promotion payload is invalid.

404 Not Found

Returned when the feed is not found.

Schema reference

Promotion

FieldTypeRequiredDescription
idstringYesPromotion identifier.
titlestringYesPromotion title.
descriptionDescriptionNoPromotion description content.
statusPromotionStatusNoPromotion status.
active_periodDateTimeRangeYesStart and end time for the promotion.
benefitsPromotionBenefit[]YesBenefits applied by the promotion.
applies_toProductTarget[]NoProducts or variants targeted by the promotion.
urlstring (uri)NoCanonical promotion URL.

Description

At least one of the following fields must be present.

FieldTypeRequiredDescription
plainstringNoPlain-text description.
htmlstringNoHTML description.
markdownstringNoMarkdown description.

Price

FieldTypeRequiredDescription
amountintegerYesMonetary amount expressed in ISO 4217 minor units.
currencystringYesCurrency identifier.

DateTimeRange

FieldTypeRequiredDescription
start_timestringYesStart timestamp.
end_timestringYesEnd timestamp.

PromotionStatus

PromotionStatus is a string. Known values include draft, scheduled, active, expired, and disabled.

PromotionBenefit

PromotionBenefit is a union of:

  • AmountOffBenefit
  • PercentOffBenefit
  • FreeShippingBenefit

AmountOffBenefit

FieldTypeRequiredDescription
typeconstYesMust be amount_off.
amount_offPriceYesAmount discounted.

PercentOffBenefit

FieldTypeRequiredDescription
typeconstYesMust be percent_off.
percent_offnumberYesPercentage discounted.

FreeShippingBenefit

FieldTypeRequiredDescription
typeconstYesMust be free_shipping.

ProductTarget

FieldTypeRequiredDescription
product_idstringYesProduct targeted by the promotion.
variant_idsstring[]NoVariants targeted within the product.