Skip to content

Dynamic Offer Promo Code Decision

Process promo code decisions

Request

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).

Security
CookieBlaizeSession or JwtQuery or JwtHeaderXBlaizeJwt or JwtHeaderXZephrJwt or JwtBearer or JwtCookie
Bodyapplication/json
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.

selected_productsArray of objects or null(promo-code-decision-request-selected-product)
sessionstring or null

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

foreign_keysobject or null

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

ipstring or null

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

user_agentstring or null

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

jwtstring or null

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

pathstring or null

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.

{ "promo_code": "string", "promo_code_definition": "string", "selected_products": [ { … } ], "session": "string", "foreign_keys": {}, "ip": "string", "user_agent": "string", "jwt": "string", "path": "string", "content_id": "string" }

Responses

OK

Headers
any
Bodyapplication/json
productsArray of objects(do-product-response)

The processed output for mainly the Product rule. Price and Discount, if present, the output of those would be nested under each product element according to the rule specification.

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

outcomesArray of objects

The rule outcome for each property rule within the offer. If you wish to record user conversion data, you would need to send these outcome data back to Zephr upon when the conversion is happening.

errorsArray of objects
Response
{ "products": [ { … } ], "tagline": "string", "custom": {}, "outcomes": [ { … } ], "errors": [ { … } ] }