Ativar ou desativar platform fee do merchant
curl --request PATCH \
--url https://api.malga.io/v1/merchants/{merchantId}/platform-fee/enabled \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <api-key>' \
--header 'X-Client-Id: <api-key>' \
--data '
{
"enabled": true
}
'const options = {
method: 'PATCH',
headers: {
'X-Client-Id': '<api-key>',
'X-Api-Key': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({enabled: true})
};
fetch('https://api.malga.io/v1/merchants/{merchantId}/platform-fee/enabled', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.malga.io/v1/merchants/{merchantId}/platform-fee/enabled"
payload := strings.NewReader("{\n \"enabled\": true\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("X-Client-Id", "<api-key>")
req.Header.Add("X-Api-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"platformFeeEnabled": true
}{
"error": {
"type": "bad_request",
"code": "PLATFORM_FEE_RULES_REQUIRED_TO_ENABLE",
"message": "At least one platform fee rule is required to enable the feature",
"details": "At least one platform fee rule is required to enable the feature"
}
}Platform Fee
Ativar ou desativar platform fee do merchant
Liga ou desliga a platform fee da subconta. A flag vale para a subconta inteira e para todos os sellers dela: não existe flag por seller. Para um seller não pagar taxa, cadastre para ele uma regra com percentage: 0 e fixedAmount: 0.
Para ligar, a subconta precisa ter ao menos uma regra ativa própria. Regras de seller não contam: uma subconta só com regras de seller responde 400 com PLATFORM_FEE_RULES_REQUIRED_TO_ENABLE. Desligar é sempre aceito.
PATCH
/
v1
/
merchants
/
{merchantId}
/
platform-fee
/
enabled
Ativar ou desativar platform fee do merchant
curl --request PATCH \
--url https://api.malga.io/v1/merchants/{merchantId}/platform-fee/enabled \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <api-key>' \
--header 'X-Client-Id: <api-key>' \
--data '
{
"enabled": true
}
'const options = {
method: 'PATCH',
headers: {
'X-Client-Id': '<api-key>',
'X-Api-Key': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({enabled: true})
};
fetch('https://api.malga.io/v1/merchants/{merchantId}/platform-fee/enabled', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.malga.io/v1/merchants/{merchantId}/platform-fee/enabled"
payload := strings.NewReader("{\n \"enabled\": true\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("X-Client-Id", "<api-key>")
req.Header.Add("X-Api-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"platformFeeEnabled": true
}{
"error": {
"type": "bad_request",
"code": "PLATFORM_FEE_RULES_REQUIRED_TO_ENABLE",
"message": "At least one platform fee rule is required to enable the feature",
"details": "At least one platform fee rule is required to enable the feature"
}
}Path Parameters
Identificador do merchant
Body
application/json
Define se o platform fee está ativo (true) ou inativo (false) para o merchant
Example:
true
Response
Platform fee atualizado com sucesso
Estado atual do platform fee para o merchant
Example:
true
Was this page helpful?