Deletar uma regra de platform fee pelo ID
curl --request DELETE \
--url https://api.malga.io/v1/merchants/{merchantId}/platform-fee/{platformFeeId} \
--header 'X-Api-Key: <api-key>' \
--header 'X-Client-Id: <api-key>'const options = {
method: 'DELETE',
headers: {'X-Client-Id': '<api-key>', 'X-Api-Key': '<api-key>'}
};
fetch('https://api.malga.io/v1/merchants/{merchantId}/platform-fee/{platformFeeId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.malga.io/v1/merchants/{merchantId}/platform-fee/{platformFeeId}"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("X-Client-Id", "<api-key>")
req.Header.Add("X-Api-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"error": {
"type": "bad_request",
"code": "PLATFORM_FEE_RULES_REQUIRED_WHILE_ENABLED",
"message": "The last platform fee rule of the merchant cannot be deleted while the platform fee is enabled: create another rule or disable the platform fee first",
"details": "The last platform fee rule of the merchant cannot be deleted while the platform fee is enabled: create another rule or disable the platform fee first"
}
}Platform Fee
Deletar uma regra de platform fee pelo ID
Remove uma regra pelo id, seja da subconta ou de um seller dela. Apagar a regra de um seller faz ele voltar a seguir a regra da subconta naquele método ou parcela.
Com a platform fee ligada, a última regra da subconta não pode ser removida: a resposta é 400 com PLATFORM_FEE_RULES_REQUIRED_WHILE_ENABLED, e a regra continua. Crie outra regra da subconta antes ou desligue a platform fee. Regras de seller não contam e podem ser removidas sempre.
DELETE
/
v1
/
merchants
/
{merchantId}
/
platform-fee
/
{platformFeeId}
Deletar uma regra de platform fee pelo ID
curl --request DELETE \
--url https://api.malga.io/v1/merchants/{merchantId}/platform-fee/{platformFeeId} \
--header 'X-Api-Key: <api-key>' \
--header 'X-Client-Id: <api-key>'const options = {
method: 'DELETE',
headers: {'X-Client-Id': '<api-key>', 'X-Api-Key': '<api-key>'}
};
fetch('https://api.malga.io/v1/merchants/{merchantId}/platform-fee/{platformFeeId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.malga.io/v1/merchants/{merchantId}/platform-fee/{platformFeeId}"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("X-Client-Id", "<api-key>")
req.Header.Add("X-Api-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"error": {
"type": "bad_request",
"code": "PLATFORM_FEE_RULES_REQUIRED_WHILE_ENABLED",
"message": "The last platform fee rule of the merchant cannot be deleted while the platform fee is enabled: create another rule or disable the platform fee first",
"details": "The last platform fee rule of the merchant cannot be deleted while the platform fee is enabled: create another rule or disable the platform fee first"
}
}Was this page helpful?