Skip to content

Process dynamic offer decisions

Request

The Dynamic Offer Decision Engine can be invoked via the Public API to calculate a decision output response based upon each property rule under the Dynamic Offer created in the Zephr Console.

Security
CookieBlaizeSession or JwtQuery or JwtHeaderXBlaizeJwt or JwtHeaderXZephrJwt or JwtBearer or JwtCookie
Bodyapplication/json
dynamic_offerobjectrequired

The dynamic offer to evaluate, must specify the slug of the dynamic offer, and any custom input to be used in the rules.

Example:
{ "slug": "offerX", "inputs": {} }
sessionstring

Zephr Session ID, required for trials

Example:"xxx-xxx-xxx"
foreign_keysobject

Foreign system and ID used to identify the user.

Example:
{}
ipstring

Client IP address, defaults to request IP.

Example:"x.x.x.x"
user_agentstring

Client user agent

Example:"Mozilla/5.0 (Macintosh; Intel Mac OS X 11)..."
jwtstring

A JSON Web Token, may include identity or product holding claims.

Example:"xxx-xxx-xxx"
pathstring

Request path, required for trials if used.

Example:"/x.html"
content_idstring

Content ID, used to perform requests to a 3rd party API for additional content information used in making a decision.

Example:"xxx-xxx-xxx"
{ "dynamic_offer": { "slug": "offerX", "inputs": {} }, "session": "xxx-xxx-xxx", "foreign_keys": {}, "ip": "x.x.x.x", "user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 11)...", "jwt": "xxx-xxx-xxx", "path": "/x.html", "content_id": "xxx-xxx-xxx" }

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": [ { … } ] }