The Promo Code, generated from the Zephr console.
Public API Reference (2025-07-30)
The Zephr Public API provides common client-side actions tied to a session cookie. Unlike the Admin API, neither users nor other resources can be dereferenced; the only data that can be accessed is owned by the user who is currently signed-in. This design is used to protect other users from malicious attacks.
You can find the base URL for the Public API by navigating to your site domains. To do this, select Sites from the Delivery menu, select your site, and then click the Site Domains button. The base URL is the Live domain.
Zephr forms use the Public API by default, with relative URLs based on the base URL.
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).
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.
Zephr Session ID, required for trials. Only relevant for executing promo code with a linked dynamic offer.
Foreign system and ID used to identify the user. Only relevant for executing promo code with a linked dynamic offer.
Client IP address, defaults to request IP. Only relevant for executing promo code with a linked dynamic offer.
Client user agent. Only relevant for executing promo code with a linked dynamic offer.
A Json Web Token, may include identity or product holding claims. Only relevant for executing promo code with a linked dynamic offer.
Request path, required for trials if used. Only relevant for executing promo code with a linked dynamic offer.
- Mock serverhttps://developer.zuora.com/_mock/zephr-api-reference/zephr-public-api/zephr/public/decisions/v1/promo-codes
- https://demo-site/zephr/public/decisions/v1/promo-codes
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X POST \
https://developer.zuora.com/_mock/zephr-api-reference/zephr-public-api/zephr/public/decisions/v1/promo-codes \
-H 'Content-Type: application/json' \
-b blaize_session=YOUR_API_KEY_HERE \
-d '{
"promo_code": "string",
"promo_code_definition": "string",
"selected_products": [
{
"id": "product-a",
"payment_plan": {
"provider": "zuora-billing",
"plan_id": "string",
"charges": [
{
"charge_definition_id": "string",
"currency": "string",
"price": 0
}
]
}
}
],
"session": "string",
"foreign_keys": {},
"ip": "string",
"user_agent": "string",
"jwt": "string",
"path": "string",
"content_id": "string"
}'OK
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.
key value pair of any custom property rule output. The key would be the property id, the value would be its rule output
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.
{ "products": [ { … } ], "tagline": "string", "custom": {}, "outcomes": [ { … } ], "errors": [ { … } ] }
Request
Generates a new preview of the price that Stripe will charge the customer if they create a new subscription for the specified plan. Note: This method does not create any entities in Stripe and does not result in any payments being made.
- Mock serverhttps://developer.zuora.com/_mock/zephr-api-reference/zephr-public-api/zephr/payment/stripe/subscriptions/{externalId}/change-previews
- https://demo-site/zephr/payment/stripe/subscriptions/{externalId}/change-previews
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X POST \
'https://developer.zuora.com/_mock/zephr-api-reference/zephr-public-api/zephr/payment/stripe/subscriptions/{externalId}/change-previews' \
-H 'Content-Type: application/json' \
-b blaize_session=YOUR_API_KEY_HERE \
-d '{
"plan_id": "string"
}'{ "total": 5000, "sub_total": 4500 }