Zum Inhalt springen

Simula a taxa e os juros de parcelamento de uma venda da comunidade

POST/api/fees/simulate

Auth
Token erforderlich
X-CommunityId
X-CommunityId Sende 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

NameTypBeschreibung
X-CommunityIdoptionalstring (uuid)ID da comunidade em que a operação acontece. Obrigatório na maioria dos endpoints com escopo de comunidade.

Request-Body application/json

NameTypBeschreibung
amountPflichtnumberAmount must be greater than 0
paymentMethodPflichtPIX | CREDIT_CARD | DEBIT_CARD | BOLETOInvalid payment method
installmentsoptionalintegerInstallments must be between 1 and 12
feePayeroptionalORGANIZATION | BUYER | COMMUNITY | CUSTOMERQuem paga a taxa da plataforma; padrão BUYER
installmentInterestPayeroptionalORGANIZATION | BUYER | COMMUNITY | CUSTOMERQuem paga os juros de parcelamento; padrão BUYER
currencyoptionalBRL | USD | EURInvalid currency
countryCodeoptionalstringCountry code must be 2 characters · min 2, max 2

Antworten

StatusBeschreibung
201Operação realizada com sucesso.
400Requisição inválida — falha de validação.
401Token ausente, inválido ou expirado.
404Recurso não encontrado.
500Erro 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"}'