Promotions

Search for promotions

Sample request for getting promotions that are valid during the time interval 2024-10-01 - 2024-10-07

POST /api/Promotions/Search
{
    {
      "activatedBeforeDate": "2024-10-01T00:00:00",
      "endedAfterDate": "2024-10-07T00:00:00",
      "marketIds": ["NOR"],
      "page":1,
      "take":10
    }
}
        
        

Sample request for getting promotions that will become active during the time interval 2024-10-01 - 2024-10-07, for shipping and order amount promotion types

POST /api/Promotions/Search
{
    {
      "promotionTypes": ["ShippingPromotion", "OrderAmountPromotion"],
      "activeFrom": "2024-10-01T00:00:00",
      "activatedBeforeDate": "2024-10-07T00:00:00",
      "marketIds": ["NOR"],
      "page": 1,
      "take": 10
    }
}
        

Sample request for fetching a known set of promotions in one call, e.g. the ids found in promotionIds on products or in promotion events (max 250 ids per request; set take to at least the number of ids)

POST /api/Promotions/Search
{
    {
      "promotionIds": ["promo-1", "promo-2", "promo-3"],
      "page": 1,
      "take": 100
    }
}
        

For bulk extraction of large result sets, use POST /api/Promotions/Search/Scroll instead.

post/api/Promotions/Search

Request

  • Base URL: https://api.omnium.no (the document declares no server; this is the origin it was published from)
  • URL: https://api.omnium.no/api/Promotions/Search
  • Auth: API key in header Authorization

Request body

pageinteger

Page number, fallback to 1

takeinteger

Number of elements, fallback to 10

activatedBeforeDatestring date-time nullable

Promotions that have started before this date. Only promotions where {Promotion.ActiveFrom <= activatedBeforeDate} will be included.

endedAfterDatestring date-time nullable

Promotions that will end after this date. Only promotions where {Promotion.ActiveTo >= endedAfterDate} will be included.

activeFromstring date-time nullable

Promotions that will become active after this date. Only promotions where {Promotion.ActiveFrom >= activeFrom} will be included.

activeTostring date-time nullable

Promotions that will end before this date. Only promotions where {Promotion.ActiveTo <= activeTo} will be included.

modifiedFromstring date-time nullable

Only return promotions modified on or after this date. Useful for delta queries / polling for changes.

modifiedTostring date-time nullable

Only return promotions modified on or before this date.

createdFromstring date-time nullable

Only return promotions created on or after this date. Useful for delta queries / polling for newly created promotions.

createdTostring date-time nullable

Only return promotions created on or before this date.

marketIdsstring[] nullable

List of marketids to filter on

promotionTypesstring[] nullable

List of promotion types to filter on. Valid types: ShippingPromotion, CategoryOrBrandPromotion, ProductSearchPromotion, PriceListPromotion, MultibuyPromotion, OrderAmountPromotion, KitPromotion

promotionIdsstring[] nullable

Only return promotions with one of these ids. Use this to fetch a known set of promotions in one call, e.g. the ids found in {promotionIds} on products or in promotion events, instead of calling GET /api/Promotions/{id} once per promotion. Combines with the other filters. Maximum 250 ids per request.

Response

Success

totalHitsinteger

Total number of hits

scrollIdstring nullable

The Scroll ID is used when fetching large amounts of data. Whenever the search results yields a ContinuationToken, the Scroll endpoints should be used to continue fetching documents

isValidboolean

Deprecated

Changes

No recorded changes to this operation across all 1 revision of this API.