Simula a taxa e os juros de parcelamento de uma venda da comunidade
POST/api/fees/simulate
- Auth
- Token erforderlich
- X-CommunityId
X-CommunityIdSende die X-CommunityId der Community, in der die Operation stattfindet.
Die Beschreibungen der Endpoints stammen aus der API-Spezifikation und sind vorerst auf Portugiesisch. Die Oberfläche drumherum ist übersetzt.
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.
Header
| Name | Typ | Beschreibung |
|---|---|---|
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 | Typ | Beschreibung |
|---|---|---|
amountPflicht | number | Amount must be greater than 0 |
paymentMethodPflicht | 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 |
Antworten
| Status | Beschreibung |
|---|---|
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-Beispiel
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"}'