Simula a taxa e os juros de parcelamento de uma venda da comunidade
POST/api/fees/simulate
- Auth
- Requires a token
- X-CommunityId
X-CommunityIdSend the X-CommunityId of the community the operation happens in.
Endpoint descriptions come straight from the API specification and are in Portuguese for now. The interface around them is translated.
Mesmo cálculo do checkout (`calculateFees`). Com `installments` > 1 no cartão, a resposta traz os juros de parcelamento da Memberfy (F-43): `installmentInterestPayer`, `installmentInterestPercent`, `installmentInterest` (o que o comprador paga de juros; `0.00` quando a comunidade absorve), `totalWithInterest` e `installmentAmount`, além do objeto `installmentInterest` dentro do cálculo. `feePayer` e `installmentInterestPayer` aceitam `ORGANIZATION`/`BUYER` (e os nomes antigos `COMMUNITY`/`CUSTOMER`); o padrão dos dois é `BUYER`, como num produto. Nunca traz custo do provedor.
Headers
| Name | Type | Description |
|---|---|---|
X-CommunityIdoptional | string (uuid) | ID da comunidade em que a operação acontece. Obrigatório na maioria dos endpoints com escopo de comunidade. |
Request body application/json
| Name | Type | Description |
|---|---|---|
amountrequired | number | Amount must be greater than 0 |
paymentMethodrequired | PIX | CREDIT_CARD | DEBIT_CARD | BOLETO | Invalid payment method |
installmentsoptional | integer | Installments must be between 1 and 12 |
feePayeroptional | ORGANIZATION | BUYER | COMMUNITY | CUSTOMER | Quem paga a taxa da plataforma; padrão BUYER |
installmentInterestPayeroptional | ORGANIZATION | BUYER | COMMUNITY | CUSTOMER | Quem paga os juros de parcelamento; padrão BUYER |
currencyoptional | BRL | USD | EUR | Invalid currency |
countryCodeoptional | string | Country code must be 2 characters · min 2, max 2 |
Responses
| Status | Description |
|---|---|
201 | Operação realizada com sucesso. |
400 | Requisição inválida — falha de validação. |
401 | Token ausente, inválido ou expirado. |
404 | Recurso não encontrado. |
500 | Erro interno do servidor. |
curl example
curl -X POST "https://api.memberfy.net/api/fees/simulate" \
-H "Authorization: Bearer $TOKEN" \
-H "X-CommunityId: $COMMUNITY_ID" \
-H "Content-Type: application/json" \
-d '{"amount":10,"paymentMethod":"PIX"}'