Desativar desconto
curl --request POST \
--url https://api.deliveryvip.com.br/merchant/v3/{merchantId}/discounts/{discountId}/unavailable \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.deliveryvip.com.br/merchant/v3/{merchantId}/discounts/{discountId}/unavailable"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.deliveryvip.com.br/merchant/v3/{merchantId}/discounts/{discountId}/unavailable', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.deliveryvip.com.br/merchant/v3/{merchantId}/discounts/{discountId}/unavailable",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.deliveryvip.com.br/merchant/v3/{merchantId}/discounts/{discountId}/unavailable"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.deliveryvip.com.br/merchant/v3/{merchantId}/discounts/{discountId}/unavailable")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.deliveryvip.com.br/merchant/v3/{merchantId}/discounts/{discountId}/unavailable")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"createdAt": "2023-11-07T05:31:56Z",
"startsAt": "2023-11-07T05:31:56Z",
"endsAt": "2023-11-07T05:31:56Z",
"type": "COUPON",
"code": "<string>",
"name": "<string>",
"status": "ACTIVE",
"rules": {
"valueType": "PERCENTAGE",
"value": 123,
"minimumOrderValue": 123,
"usageLimit": 123,
"usagePerCustomer": "ONCE",
"discountType": "TOTAL"
},
"options": [
"CUMULATIVE_WITH_SMART"
]
}{
"title": "Unauthorized",
"status": 401
}{
"status": "403",
"title": "growth_discount_not_hired"
}{
"status": "404",
"title": "Record not found"
}Ações
Desativar desconto
Torna o desconto indisponível para uso.
POST
/
merchant
/
v3
/
{merchantId}
/
discounts
/
{discountId}
/
unavailable
Desativar desconto
curl --request POST \
--url https://api.deliveryvip.com.br/merchant/v3/{merchantId}/discounts/{discountId}/unavailable \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.deliveryvip.com.br/merchant/v3/{merchantId}/discounts/{discountId}/unavailable"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.deliveryvip.com.br/merchant/v3/{merchantId}/discounts/{discountId}/unavailable', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.deliveryvip.com.br/merchant/v3/{merchantId}/discounts/{discountId}/unavailable",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.deliveryvip.com.br/merchant/v3/{merchantId}/discounts/{discountId}/unavailable"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.deliveryvip.com.br/merchant/v3/{merchantId}/discounts/{discountId}/unavailable")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.deliveryvip.com.br/merchant/v3/{merchantId}/discounts/{discountId}/unavailable")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"createdAt": "2023-11-07T05:31:56Z",
"startsAt": "2023-11-07T05:31:56Z",
"endsAt": "2023-11-07T05:31:56Z",
"type": "COUPON",
"code": "<string>",
"name": "<string>",
"status": "ACTIVE",
"rules": {
"valueType": "PERCENTAGE",
"value": 123,
"minimumOrderValue": 123,
"usageLimit": 123,
"usagePerCustomer": "ONCE",
"discountType": "TOTAL"
},
"options": [
"CUMULATIVE_WITH_SMART"
]
}{
"title": "Unauthorized",
"status": 401
}{
"status": "403",
"title": "growth_discount_not_hired"
}{
"status": "404",
"title": "Record not found"
}Autorizações
Token de acesso opaco emitido pela API de autenticação (POST /authentication/v1/oauth/token).
Parâmetros de caminho
Id (UUID) da loja na plataforma. A loja precisa estar autorizada para o aplicativo.
Id (UUID) do desconto.
Resposta
Desconto desativado.
Omitido quando o desconto não tem fim de vigência.
Opções disponíveis:
COUPON, SMART Código do cupom. Presente apenas em COUPON.
Nome do desconto. Presente apenas em SMART.
Situação da vigência.
Opções disponíveis:
ACTIVE, SCHEDULED, OVERDUE Show child attributes
Show child attributes
Omitido quando não há opções.
Opções disponíveis:
CUMULATIVE_WITH_SMART, NON_PROMOTION_PRODUCTS, SUBSCRIBER