v1

latestOpenAPI 3.0.02026-08-0610682246.0 KB
Dynamic Offer Promo Code Decision

Process promo code decisions

The Promo Code decision would execute the discount rule defined behind the given promo code, which is configured from the Zephr console. The decision request would require a list of relevant products with its pricing data, typically it would have come from a Dynamic Offer decision response. The Promo Code decision would generate decision response like a regular Dynamic Offer, but with the discount output according to the Promo Code's discount rule.

Alternatively, if configured and the feature is enabled, this api can execute a dynamic offer rule that is linked to this promo code. Selected products are not required for executing promo codes using this method. Parameters supplied to the dynamic offers decisions api can also be supplied to this api for this promo code flow (session, foreign_keys, etc).

post/zephr/public/decisions/v1/promo-codes

Request body

promo_codestring

The Promo Code, generated from the Zephr console.

promo_code_definitionstring

The Definition ID of Promo Code, generated from the Zephr console. This is useful for previewing a draft promo code rule/offer as there won't be any downloadble/usable promo code generated.

sessionstring nullable

Zephr Session ID, required for trials. Only relevant for executing promo code with a linked dynamic offer.

foreign_keysobject nullable

Foreign system and ID used to identify the user. Only relevant for executing promo code with a linked dynamic offer.

ipstring nullable

Client IP address, defaults to request IP. Only relevant for executing promo code with a linked dynamic offer.

user_agentstring nullable

Client user agent. Only relevant for executing promo code with a linked dynamic offer.

jwtstring nullable

A Json Web Token, may include identity or product holding claims. Only relevant for executing promo code with a linked dynamic offer.

pathstring nullable

Request path, required for trials if used. Only relevant for executing promo code with a linked dynamic offer.

content_idstring

Content ID, used to perform requests to a 3rd party API for additional content information used in making a decision. Only relevant for executing promo code with a linked dynamic offer.

Example request

{
  "selected_products": [
    {
      "id": "product-a",
      "payment_plan": {
        "provider": "zuora-billing"
      }
    }
  ]
}

Response

OK

taglinestring

The tagline rule output

customobject

key value pair of any custom property rule output. The key would be the property id, the value would be its rule output