Apply discount
Changed onApply a discount to an opportunity. More than one discount (one per call) can be applied to an opportunity. The response is an updated opportunity summary. The discount is applied to all eligible products. However, redemption limits apply. When the redemption limits exceed the contents of the opportunity, the discount is not applied.
Required: Accept-Language header with Locale format. For example: en-US
Request
- Base URLhttps://marketplace.appdirect.com/api
- Authnone declared
- TypeScriptA function with typed inputs. Its response is checked against the schema.
Path parameters
Opportunity ID
Request body
Example request
{
"discountCode": "10%OFF",
"itemIds": [
"166e0ce6-4309-4a16-ac9b-61bea7ce1cbc",
"fa776d2e-cda5-4256-9a27-125a0fe3f448"
]
}Response
The discount was applied and the request returned an updated opportunity summary
Example response
{
"amountDueBeforeTax": "0.0000000000",
"taxSummary": [],
"amountDueAfterTax": "0.0000000000",
"items": [
{
"id": "c57331b7-0820-44ac-ad75-ee4ab2783b7c",
"product": {
"id": "fa776d2e-cda5-4256-9a27-125a0fe3f448",
"name": "Supported Product for Opportunity MVP",
"type": "WEB_APP_STACKED",
"isAddon": false,
"hasAddons": false
},
"pricingPlan": {
"id": "7e1fd1fa-de0e-49e9-9e6a-9c474c57f22d",
"name": "Tiered monthly+yearly flat with included YEARLY",
"editionCode": "Tiered monthly+yearly flat with included"
},
"pricing": [
{
"costType": "RECURRING_FLAT",
"description": "Tiered monthly+yearly flat with included",
"quantity": "1.0000000000",
"totalSalePrice": "240.0000000000"
},
{
"costType": "INCLUDED",
"description": "INCLUDED",
"quantity": "1.0000000000",
"totalSalePrice": "0.0000000000"
}
],
"contractConfiguration": {
"minimumServiceLength": 1,
"minimumServiceLengthUnit": "YEARLY",
"unitTerms": {},
"blockContractUpgrades": true,
"blockContractDowngrades": true,
"blockSwitchToShorterContract": true,
"keepContractDateOnPlanChange": true
},
"unitDefinitions": [
{
"unit": "USER",
"minimum": "1.0000000000",
"meteredUsage": false,
"allowDecimals": false,
"readOnly": true,
"pricePerIncrement": false
}
]
}
],
"recurringTotals": [
{
"billingCycle": {
"period": "YEARLY",
"dayOfMonth": 17
},
"totalSalePrice": "240.0000000000"
}
]
}Changes
- breaking
the request's body type changed from no type to
object - breaking
the response's body type changed from no type to
objectfor status - breaking
the response's body type changed from no type to
objectfor status - breaking
the response's body type changed from no type to
objectfor status - breaking
the response's body type changed from no type to
objectfor status - breaking
the response's body type changed from no type to
objectfor status - breaking
the response's body type changed from no type to
objectfor status - breaking
the response's body type changed from no type to
objectfor status - info
added the new optional request property
- info
added the new optional request property
- info
added the optional property
to the response with the status - info
added the optional property
to the response with the status - info
added the optional property
to the response with the status - info
added the optional property
to the response with the status - info
added the optional property
to the response with the status - info
added the optional property
to the response with the status - info
added the optional property
to the response with the status - info
added the optional property
to the response with the status - info
added the optional property
to the response with the status - info
added the optional property
to the response with the status - info
added the optional property
to the response with the status - info
added the required property
to the response with the status - info
added the required property
to the response with the status - info
added the required property
to the response with the status - info
added the required property
to the response with the status - info
added the required property
to the response with the status - info
added the required property
to the response with the status - info
added the required property
to the response with the status - info
added the required property
to the response with the status - info
added the required property
to the response with the status - info
added the required property
to the response with the status - info
added the required property
to the response with the status - info
added the required property
to the response with the status - info
added the required property
to the response with the status - info
added the required property
to the response with the status - info
added the required property
to the response with the status - info
added the required property
to the response with the status - info
added the required property
to the response with the status - info
added the required property
to the response with the status
- breaking