Update an offer

Updates an existing offer by ID. All fields are optional except title and itemCount.

put/offers/{id}

Request

  • Base URL
    https://api.ecommerceapi.uk/v1
  • URL
    https://api.ecommerceapi.uk/v1/offers/{id}
  • Auth
    HTTP basic

Path parameters

idinteger required

The unique identifier of the offer.

Request body

activeboolean

Indicates if the offer is active.

titlestring

The title of the offer. Cannot be empty.

descriptionstring

Description of the offer.

startDatestring date-time

When the offer starts. Empty string will reset the start date.

endDatestring date-time

When the offer ends. Empty string will reset the end date.

discountType'fixed_price' | 'percent' | 'monetary'

Type of discount for the offer.

discountAmountnumber

Discount amount. If discountType is percent, must be between 0 and 100.

maximumDiscountAmountnumber

Maximum monetary discount if using percent. Leave unset if not applicable.

itemCountinteger

Number of products needed to qualify (must be greater than 0).

itemSortOrder'price_asc' | 'price_desc'

The order used to pick items for discount.

supportsPreOrderProductsboolean

Whether the offer applies to pre-order products.

productShippingStartDatestring date-time

Shipping start date for the excluded pre-order products. Empty string or unset if not used.

productShippingEndDatestring date-time

Shipping end date for the excluded pre-order products. Empty string or unset if not used.

excludedProductsinteger[]

An array of product IDs excluded from the offer.

Response

Offer updated successfully.

idinteger

Unique identifier for the offer.

createdAtstring date-time

Timestamp when the offer was created.

activeboolean

Indicates if the offer is active.

titlestring

The title of the offer.

descriptionstring

Description of the offer.

startDatestring date-time

Date/time when the offer starts. Empty string means unset.

endDatestring date-time

Date/time when the offer ends. Empty string means unset.

discountType'fixed_price' | 'percent' | 'monetary'

Type of discount applied.

discountAmountnumber

Amount of the discount. If discountType is percent, must be between 0 and 100.

maximumDiscountAmountnumber

Maximum monetary discount limit when using percent discount type. Empty or unset if not applicable.

itemCountinteger

Number of products the customer must purchase from this offer to qualify.

itemSortOrder'price_asc' | 'price_desc'

Determines how items are sorted to form the offer.

excludedProductsinteger[]

An array of product IDs excluded from the offer.

supportsPreOrderProductsboolean

Whether this offer applies to products that are on pre-order.

productShippingStartDatestring date-time

Shipping start date for the excluded pre-order products. Empty string if none.

productShippingEndDatestring date-time

Shipping end date for the excluded pre-order products. Empty string if none.

Changes

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