Skip to main content
POST
/
v1
/
merchants
/
{merchantId}
/
platform-fee
Criar regras de platform fee
curl --request POST \
  --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
  }
]
'
[
  {
    "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"
  }
]

Authorizations

X-Client-Id
string
header
required
X-Api-Key
string
header
required

Path Parameters

merchantId
string<uuid>
required

Identificador do merchant

Body

application/json
paymentMethod
enum<string>
required

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.

Available options:
credit,
pix,
boleto,
default
Example:

"credit"

percentage
number<float>

Percentual da taxa (0-100) com até 2 casas decimais. Ao menos um entre percentage e fixedAmount deve ser informado.

Required range: 0 <= x <= 100
Example:

2.5

fixedAmount
integer

Valor fixo da taxa em centavos (>= 0). Ao menos um entre percentage e fixedAmount deve ser informado.

Required range: x >= 0
Example:

50

installment
integer

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.

Required range: 1 <= x <= 24
Example:

5

Response

Regras criadas com sucesso

id
string<uuid>

Identificador único da regra de platform fee

Example:

"a1b2c3d4-e5f6-7890-abcd-ef1234567890"

percentage
number<float> | null

Percentual da taxa aplicado

Example:

2.5

fixedAmount
integer | null

Valor fixo da taxa em centavos

Example:

50

paymentMethod
enum<string>

Método de pagamento ao qual a regra se aplica (default indica regra de fallback).

Available options:
credit,
pix,
boleto,
default
Example:

"credit"

installment
integer | null

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).

Example:

5

createdAt
string<date-time>

Data de criação da regra

Example:

"2024-01-15T10:30:00.000Z"

updatedAt
string<date-time>

Data da última atualização da regra

Example:

"2024-01-15T10:30:00.000Z"