Version v2 of the Content API is scheduled for sunset on September 30th, 2021. Onboarding to v2 ended on April 30, 2021. To avoid disruptions with your integration, please migrate to v2.1 as soon as possible.

For more information, see Migrating to v2.1 and this blog post.

REST Resource: repricingrules

Resource: RepricingRule

Represents a repricing rule. A repricing rule is used by shopping serving to adjust transactable offer prices if conditions are met. Next ID: 24

JSON representation
{
  "ruleId": string,
  "merchantId": string,
  "countryCode": string,
  "languageCode": string,
  "title": string,
  "paused": boolean,
  "eligibleOfferMatcher": {
    object (EligibleOfferMatcher)
  },
  "effectiveTimePeriod": {
    object (EffectiveTime)
  },
  "type": enum (RepricingRuleType),
  "restriction": {
    object (Restriction)
  },

  // Union field RuleDefinition can be only one of the following:
  "statsBasedRule": {
    object (StatsBasedRule)
  },
  "cogsBasedRule": {
    object (CostOfGoodsSaleRule)
  }
  // End of list of possible types for union field RuleDefinition.
}
Fields
ruleId

string

Output only. Immutable. The ID to uniquely identify each repricing rule.

merchantId

string (int64 format)

Output only. Immutable. Merchant that owns the repricing rule.

countryCode

string

Required. Immutable. CLDR country code (e.g. "US").

languageCode

string

Required. Immutable. The two-letter ISO 639-1 language code associated with the repricing rule.

title

string

The title for the rule.

paused

boolean

Represents whether a rule is paused. A paused rule will behave like a non-paused rule within CRUD operations, with the major difference that a paused rule will not be evaluated and will have no effect on offers.

eligibleOfferMatcher

object (EligibleOfferMatcher)

Required. Match criteria for the eligible offers.

effectiveTimePeriod

object (EffectiveTime)

Required. Time period when the rule should take effect.

type

enum (RepricingRuleType)

Required. Immutable. The type of the rule.

restriction

object (Restriction)

Required. Restriction of the rule appliance.

Union field RuleDefinition. Definition of the rule to achieve above goal. RuleDefinition can be only one of the following:
statsBasedRule

object (StatsBasedRule)

The rule definition for TYPE_STATS_BASED. Required when the rule type is TYPE_STATS_BASED.

cogsBasedRule

object (CostOfGoodsSaleRule)

The rule definition for TYPE_COGS_BASED. Required when the rule type is TYPE_COGS_BASED.

EligibleOfferMatcher

Matcher that specifies eligible offers. When the USE_FEED_ATTRIBUTE option is selected, only the repricingRuleId attribute on the product feed is used to specify offer-rule mapping. When the CUSTOM_FILTER option is selected, only the *_matcher fields are used to filter the offers for offer-rule mapping. If the CUSTOM_FILTER option is selected, an offer needs to satisfy each custom filter matcher to be eligible for a rule. Size limit: the sum of the number of entries in all the matchers should not exceed 20. For example, there can be 15 product ids and 5 brands, but not 10 product ids and 11 brands.

JSON representation
{
  "matcherOption": enum (MatcherOption),
  "offerIdMatcher": {
    object (StringMatcher)
  },
  "itemGroupIdMatcher": {
    object (StringMatcher)
  },
  "brandMatcher": {
    object (StringMatcher)
  },
  "skipWhenOnPromotion": boolean
}
Fields
matcherOption

enum (MatcherOption)

Determines whether to use the custom matchers or the product feed attribute "repricingRuleId" to specify offer-rule mapping.

offerIdMatcher

object (StringMatcher)

Filter by the offer id.

itemGroupIdMatcher

object (StringMatcher)

Filter by the item group id.

brandMatcher

object (StringMatcher)

Filter by the brand.

skipWhenOnPromotion

boolean

When true, the rule won't be applied to offers with active promotions.

MatcherOption

Options for how offers are matched to rules.

Enums
MATCHER_OPTION_UNSPECIFIED Unused.
MATCHER_OPTION_CUSTOM_FILTER Use custom filters.
MATCHER_OPTION_USE_FEED_ATTRIBUTE Use repricingRuleId feed attribute on the product resource to specify offer-rule mapping.
MATCHER_OPTION_ALL_PRODUCTS Matching all products.

StringMatcher

Matcher by string attributes.

JSON representation
{
  "strAttributes": [
    string
  ]
}
Fields
strAttributes[]

string

String attributes, as long as such attribute of an offer is one of the string attribute values, the offer is considered as passing the matcher. The string matcher checks an offer for inclusivity in the string attributes, not equality. Only literal string matching is supported, no regex.

EffectiveTime

JSON representation
{
  "fixedTimePeriods": [
    {
      object (FixedTimePeriod)
    }
  ]
}
Fields
fixedTimePeriods[]

object (FixedTimePeriod)

A list of fixed time periods combined with OR. The maximum number of entries is limited to 5.

FixedTimePeriod

Definition of a fixed time period.

JSON representation
{
  "startTime": string,
  "endTime": string
}
Fields
startTime

string (Timestamp format)

The start time (inclusive) of the period. It can only be hour granularity.

endTime

string (Timestamp format)

The end time (exclusive) of the period. It can only be hour granularity.

RepricingRuleType

Possible types of a rule.

Enums
REPRICING_RULE_TYPE_UNSPECIFIED Unused.
TYPE_STATS_BASED Statistical measurement based rules among Google SA merchants. If this rule is chosen, repricer will adjust the offer price based on statistical metrics (currently only min is available) among other merchants who sell the same product. Details need to be provdided in the RuleDefinition.
TYPE_COGS_BASED Cost of goods sale based rule. Repricer will adjust the offer price based on the offer's sale cost which is provided by the merchant.
TYPE_SALES_VOLUME_BASED Sales volume based rule. Repricer will adjust the offer price based on the offer's sales volume in the past period of time defined within the rule.
TYPE_COMPETITIVE_PRICE Competitive price rule. Repricer will adjust the offer price based on the min price from a list of unnamed big competitors.

StatsBasedRule

Definition of stats based rule.

JSON representation
{

  // Union field delta can be only one of the following:
  "priceDelta": string,
  "percentageDelta": integer
  // End of list of possible types for union field delta.
}
Fields
Union field delta. The change of price compared to statistical measure. delta can be only one of the following:
priceDelta

string

The price delta against the above price target. A positive value means the price should be adjusted to be above statistical measure, and a negative value means below. Currency code must not be included.

percentageDelta

integer

The percent change against the price target. Valid from 0 to 100 inclusively.

CostOfGoodsSaleRule

A repricing rule that changes the sale price based on cost of goods sale.

JSON representation
{

  // Union field delta can be only one of the following:
  "priceDelta": string,
  "percentageDelta": integer
  // End of list of possible types for union field delta.
}
Fields
Union field delta. This rule is defined relative to the COGS. The delta can be 1.2x of the COGS, or $100 more of the COGS. delta can be only one of the following:
priceDelta

string

The price delta against the COGS. E.g. 2 means $2 more of the COGS.

percentageDelta

integer

The percent change against the COGS. Ex: 20 would mean to set the adjusted price 1.2X of the COGS data.

Restriction

Definition of a rule restriction. At least one of the following needs to be true: (1) useAutoPricingMinPrice is true (2) floor.price_delta exists (3) floor.percentage_delta exists If floor.price_delta and floor.percentage_delta are both set on a rule, the highest value will be chosen by the Repricer. In other words, for a product with a price of $50, if the floor.percentage_delta is "-10" and the floor.price_delta is "-12", the offer price will only be lowered $5 (10% lower than the original offer price).

JSON representation
{
  "useAutoPricingMinPrice": boolean,
  "floor": {
    object (Boundary)
  }
}
Fields
useAutoPricingMinPrice

boolean

If true, use the AUTO_PRICING_MIN_PRICE offer attribute as the lower bound of the rule. If useAutoPricingMinPrice is true, then only offers with AUTO_PRICING_MIN_PRICE existing on the offer will get Repricer treatment, even if a floor value is set on the rule. Also, if useAutoPricingMinPrice is true, the floor restriction will be ignored.

floor

object (Boundary)

The inclusive floor lower bound. The repricing rule only applies when new price >= floor.

Boundary

Definition of a boundary.

JSON representation
{

  // Union field delta can be only one of the following:
  "priceDelta": string,
  "percentageDelta": integer
  // End of list of possible types for union field delta.
}
Fields
Union field delta. The price change relative to the base price. delta can be only one of the following:
priceDelta

string

The price micros relative to the offer selling price. This field is signed. It must be negative in floor. For example, if an offer is selling at $10 and this field is -$2 in floor, the repricing rule only applies if the calculated new price is

= $8.

percentageDelta

integer

The percentage delta relative to the offer selling price. This field is signed. It must be negative in floor. When it is used in floor, it should be > -100. For example, if an offer is selling at $10 and this field is -30 in floor, the repricing rule only applies if the calculated new price is >= $7.

Methods

create

Creates a repricing rule for your Merchant Center account.

delete

Deletes a repricing rule in your Merchant Center account.

get

Retrieves a repricing rule from your Merchant Center account.

list

Lists the repricing rules in your Merchant Center account.

patch

Updates a repricing rule in your Merchant Center account.