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)
OK
Bad Request
Not Found
{- "promo_code": "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"
}
{- "products": [
- {
- "id": "string",
- "label": "string",
- "description": "string",
- "features": [
- {
- "id": "string",
- "label": "string",
- "description": "string",
- "type": "string"
}
], - "sharingLimit": 0,
- "metadata": {
- "order": 0,
- "recommended": true
}, - "paymentPlans": [
- {
- "planId": "string",
- "planData": { },
- "charges": [
- {
- "chargeId": "string",
- "prices": [
- { }
], - "chargeDefinitionData": { },
- "chargeData": { },
- "discounts": [
- null
]
}
]
}
], - "attributes": { }
}
], - "tagline": "string",
- "custom": { },
- "outcomes": [
- {
- "ruleId": "string",
- "outcomeId": "string"
}
], - "errors": [
- {
- "property": "string",
- "error": "string"
}
]
}