Create or update promotion or tax
Changed onCreates or updates a specific Promotion by its Promotion ID or a specific tax by its tax ID.
⚠️ You should always include both the id and name when registering objects in the request body.
Permissions
Any user or API key must have at least one of the appropriate License Manager resources to be able to successfully run this request. Otherwise they will receive a status code 403 error. These are the applicable resources for this endpoint:
| Product | Category | Resource |
|---|---|---|
| Rates and Benefits | Manage benefits and rates | GerenciarPromocoesETarifas |
There are no applicable predefined roles for this resource list. You must create a custom role and add at least one of the resources above in order to use this endpoint. To learn more about machine authentication at VTEX, see Authentication overview.
❗ To prevent integrations from having excessive permissions, consider the best practices for managing API keys when assigning License Manager roles to integrations.
Request
- Base URLhttps://apiexamples.vtexcommercestable.com.br
- URLhttps://apiexamples.vtexcommercestable.com.br/api/rnb/pvt/calculatorconfiguration
- Auth
- API key in header X-VTEX-API-AppKey and API key in header X-VTEX-API-AppToken
- or API key in header VtexIdclientAutCookie
Headers
Type of the content being sent.
HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand.
Request body
Example request
{
"idCalculatorConfiguration": "ba087fa9-8587-44b3-8ef1-ade8d053e9e9",
"name": "Promoção Social Seller",
"description": "Description of the promotion.",
"beginDateUtc": "2020-05-01T18:47:15.89Z",
"endDateUtc": "2020-05-01T18:47:15.89Z",
"lastModified": "2021-02-23T20:58:38.7963862Z",
"isActive": true,
"isFeatured": true,
"activeDaysOfWeek": [
"Monday"
],
"offset": -3,
"newOffset": -3,
"maxPricesPerItems": [
"100"
],
"discountType": "percentual",
"nominalDiscountValue": 10,
"nominalDiscountType": "item",
"percentualDiscountValue": 10,
"skusGift": {
"gifts": [
"123"
]
},
"orderStatusRewardValue": "invoiced",
"maxNumberOfAffectedItemsGroupKey": "perCart",
"origin": "marketplace",
"idSeller": "1",
"idsSalesChannel": [
"Principal"
],
"marketingTags": [
"MKT1"
],
"paymentsMethods": [
{
"id": "2",
"name": "Visa (2)"
}
],
"stores": [
"store"
],
"campaigns": [
"campaign"
],
"conditionsIds": [
"1"
],
"categories": [
{
"id": "1",
"name": "Vinhos Tintos (1)"
}
],
"categoriesAreInclusive": true,
"brands": [
{
"id": "1",
"name": "Brand (1)"
}
],
"brandsAreInclusive": true,
"products": [
{
"id": "1",
"name": "Vinho (1)"
}
],
"productsAreInclusive": true,
"skus": [
{
"id": "1",
"name": "Vinho tinto (1)"
}
],
"skusAreInclusive": true,
"utmSource": "testSource",
"utmCampaign": "testSource",
"collections1BuyTogether": [
{
"id": "157",
"name": "Inverno (157)"
}
],
"collections2BuyTogether": [
{
"id": "157",
"name": "Inverno (157)"
}
],
"listSku1BuyTogether": [
{
"id": "1",
"name": "White Shirt"
}
],
"listSku2BuyTogether": [
{
"id": "1",
"name": "White Shirt"
}
],
"coupon": [
"12345"
],
"totalValueMode": "IncludeMatchedItems",
"collections": [
{
"id": "1",
"name": "Collection (1)"
}
],
"restrictionsBins": [
"1234"
],
"cardIssuers": [
"issuer"
],
"slasIds": [
"Express"
],
"zipCodeRanges": [
{
"zipCodeFrom": "20000-000",
"zipCodeTo": "20000-100",
"inclusive": true
}
],
"installment": 1,
"merchants": [
"merchant"
],
"clusterExpressions": [
"email contains user@mail.com"
],
"paymentsRules": [
"rules"
],
"giftListTypes": [
"Gift SKU"
],
"productsSpecifications": [
"spec"
],
"affiliates": [
{
"id": "1",
"name": "Amazon"
}
],
"type": "regular",
"percentualDiscountValueList": [
10
],
"optIn": {
"sellers": [
"seller-id-1"
]
}
}Response
OK
Changes
- info
added the new optional request property
- info
added the optional property
to the response with the status
- info
- breaking
request property
was restricted to a list of enum values - warning
added the new
perCartenum value to theresponse property for the response status - warning
added the new
perProductIdenum value to theresponse property for the response status - warning
added the new
perSkuenum value to theresponse property for the response status - info
added the new
perCartenum value to the request property - info
added the new
perProductIdenum value to the request property - info
added the new
perSkuenum value to the request property
- breaking