curl --request PUT \
--url https://api.malga.io/v1/merchants/{merchantId}/platform-fee \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <api-key>' \
--header 'X-Client-Id: <api-key>' \
--data '
[
{
"paymentMethod": "credit",
"percentage": 3.5,
"fixedAmount": 50,
"installment": 3
},
{
"paymentMethod": "pix",
"fixedAmount": 50
},
{
"paymentMethod": "boleto",
"percentage": 1,
"fixedAmount": 100
}
]
'const options = {
method: 'PUT',
headers: {
'X-Client-Id': '<api-key>',
'X-Api-Key': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify([
{paymentMethod: 'credit', percentage: 3.5, fixedAmount: 50, installment: 3},
{paymentMethod: 'pix', fixedAmount: 50},
{paymentMethod: 'boleto', percentage: 1, fixedAmount: 100}
])
};
fetch('https://api.malga.io/v1/merchants/{merchantId}/platform-fee', 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"
payload := strings.NewReader("[\n {\n \"paymentMethod\": \"credit\",\n \"percentage\": 3.5,\n \"fixedAmount\": 50,\n \"installment\": 3\n },\n {\n \"paymentMethod\": \"pix\",\n \"fixedAmount\": 50\n },\n {\n \"paymentMethod\": \"boleto\",\n \"percentage\": 1,\n \"fixedAmount\": 100\n }\n]")
req, _ := http.NewRequest("PUT", 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))
}[
{
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"paymentMethod": "credit",
"percentage": 3.5,
"fixedAmount": 50,
"installment": 3,
"createdAt": "2024-01-15T10:30:00.000Z",
"updatedAt": "2024-01-15T10:30:00.000Z"
},
{
"id": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
"paymentMethod": "pix",
"percentage": null,
"fixedAmount": 50,
"installment": null,
"createdAt": "2024-01-15T10:30:00.000Z",
"updatedAt": "2024-01-15T10:30:00.000Z"
},
{
"id": "c3d4e5f6-a7b8-9012-cdef-123456789012",
"paymentMethod": "boleto",
"percentage": 1,
"fixedAmount": 100,
"installment": null,
"createdAt": "2024-01-15T10:30:00.000Z",
"updatedAt": "2024-01-15T10:30:00.000Z"
}
]Atualizar regras de platform fee
curl --request PUT \
--url https://api.malga.io/v1/merchants/{merchantId}/platform-fee \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <api-key>' \
--header 'X-Client-Id: <api-key>' \
--data '
[
{
"paymentMethod": "credit",
"percentage": 3.5,
"fixedAmount": 50,
"installment": 3
},
{
"paymentMethod": "pix",
"fixedAmount": 50
},
{
"paymentMethod": "boleto",
"percentage": 1,
"fixedAmount": 100
}
]
'const options = {
method: 'PUT',
headers: {
'X-Client-Id': '<api-key>',
'X-Api-Key': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify([
{paymentMethod: 'credit', percentage: 3.5, fixedAmount: 50, installment: 3},
{paymentMethod: 'pix', fixedAmount: 50},
{paymentMethod: 'boleto', percentage: 1, fixedAmount: 100}
])
};
fetch('https://api.malga.io/v1/merchants/{merchantId}/platform-fee', 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"
payload := strings.NewReader("[\n {\n \"paymentMethod\": \"credit\",\n \"percentage\": 3.5,\n \"fixedAmount\": 50,\n \"installment\": 3\n },\n {\n \"paymentMethod\": \"pix\",\n \"fixedAmount\": 50\n },\n {\n \"paymentMethod\": \"boleto\",\n \"percentage\": 1,\n \"fixedAmount\": 100\n }\n]")
req, _ := http.NewRequest("PUT", 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))
}[
{
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"paymentMethod": "credit",
"percentage": 3.5,
"fixedAmount": 50,
"installment": 3,
"createdAt": "2024-01-15T10:30:00.000Z",
"updatedAt": "2024-01-15T10:30:00.000Z"
},
{
"id": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
"paymentMethod": "pix",
"percentage": null,
"fixedAmount": 50,
"installment": null,
"createdAt": "2024-01-15T10:30:00.000Z",
"updatedAt": "2024-01-15T10:30:00.000Z"
},
{
"id": "c3d4e5f6-a7b8-9012-cdef-123456789012",
"paymentMethod": "boleto",
"percentage": 1,
"fixedAmount": 100,
"installment": null,
"createdAt": "2024-01-15T10:30:00.000Z",
"updatedAt": "2024-01-15T10:30:00.000Z"
}
]Path Parameters
Identificador do merchant
Body
Método de pagamento ao qual a regra se aplica. Use default para regras de fallback quando não houver regra específica para o método da transação. Nota: default não aceita installment.
credit, pix, boleto, default "credit"
Percentual da taxa (0-100) com até 2 casas decimais. Ao menos um entre percentage e fixedAmount deve ser informado.
0 <= x <= 1002.5
Valor fixo da taxa em centavos (>= 0). Ao menos um entre percentage e fixedAmount deve ser informado.
x >= 050
Número de parcelas. Obrigatório quando paymentMethod for credit; proibido nos demais. O valor informado (1-24) é agrupado em faixas de parcelamento. Apenas uma regra por faixa é permitida por merchant. Faixas: à vista (1), 2x a 6x (2-6), 7x a 12x (7-12), 13x a 24x (13-24). O valor original é armazenado e retornado; a unicidade é validada por faixa.
1 <= x <= 245
Response
Regras atualizadas com sucesso
Identificador único da regra de platform fee
"a1b2c3d4-e5f6-7890-abcd-ef1234567890"
Percentual da taxa aplicado
2.5
Valor fixo da taxa em centavos
50
Método de pagamento ao qual a regra se aplica (default indica regra de fallback).
credit, pix, boleto, default "credit"
Número de parcelas informado na criação da regra. Presente apenas para credit; null para pix, boleto e default. A unicidade é validada por faixa: à vista (1), 2x a 6x (2-6), 7x a 12x (7-12), 13x a 24x (13-24).
5
Data de criação da regra
"2024-01-15T10:30:00.000Z"
Data da última atualização da regra
"2024-01-15T10:30:00.000Z"
Related topics
Listar regras de platform feeCriar regras de platform feeDeletar uma regra de platform fee pelo IDJune 18, 2026 - Platform FeeWas this page helpful?