mng-fee-merchant-adp

information icon
Gerencial API — Fee Merchant Adapter Version 2.0.3 · Java 17 · Spring Boot 3.5.14

Overview

mng-fee-merchant-adp is a RESTful adapter microservice responsible for exposing acquisition fee data associated with merchants registered in the Getnet platform. It acts as an intermediary layer between internal consumers (front-end portals, BFFs, or other microservices) and the upstream Getnet fee management system, translating the internal domain model into a standardised, OpenAPI-compliant response format.
The service empowers partners and merchants to consult their active acquisition fees independently, increasing autonomy in negotiations and improving operational efficiency.

Functional Responsibilities

ResponsibilityDescription
Fee retrievalFetches acquisition fee data for a given merchant from the upstream Getnet API
Data transformationMaps the internal Getnet DTO model to an OpenAPI-compliant DTO model using MapStruct
Error handlingReturns structured error responses (timestamp, status, error, message, path) for 404, 500, and other HTTP error scenarios
ObservabilityExposes health, info, metrics, env, loggers, thread dump, mappings, and beans via Spring Boot Actuator
API documentationProvides interactive API documentation via Swagger UI (SpringDoc OpenAPI)

API Endpoint

GET /fee-merchant/v1/merchants/{id}

Retrieves the acquisition fee data for a specific merchant, with optional filters.

Path Parameters

ParameterTypeRequiredDescription
idLongUnique merchant identifier

Query Parameters (Filters)

ParameterTypeRequiredAllowed Values
commercial_mode_idList<Long>1 = RENT, 2 = SALE
operator_idList<Long>141 = MASTERCARD, 154 = VISA, 229 = AMEX, 230 = ELO, 231 = HIPERCARD
capture_method_fee_idList<Long>63 = IATA, 45 = E-COMMERCE, 13 = VERMELHINHA, 99 = CONVENCIONAL, 74 = SUPERGET, 77 = QRCODE

Request Headers

HeaderTypeRequiredDescription
app-userLongApplication user identifier (authorization & audit)
system-userLongSystem user identifier (audit & traceability)

Response Codes

CodeDescription
200 OKFee data retrieved successfully
400 Bad RequestInvalid request parameters
401 UnauthorizedMissing or invalid authentication credentials
403 ForbiddenInsufficient permissions to access the resource
404 Not FoundMerchant not found for the given ID
409 ConflictConflict with the current state of the resource
500 Internal Server ErrorUnexpected server-side error
504 Gateway TimeoutUpstream service did not respond in time

Response Model

EstablishmentDTO

text
{ "merchant_id": 123456, "pre_registration_id": 654321, "document": "12345678000199", "payment_plan": "Standard Plan", "operators": [ { "operator_id": 154, "operator_description": "VISA", "fees": [ { "commercial_mode_id": 1, "commercial_mode_description": "RENT", "capture_method_fees": [ { "capture_method_fee_id": 99, "capture_method_fee_description": "CONVENCIONAL", "sales_plans": [ { "installments": 1, "fee_percentage": 2.35 } ] } ] } ] } ] }

Error Response Model

text
{ "timestamp": "2026-05-15T18:07:45.425707849", "status": 404, "error": "NOT_FOUND", "message": "Merchant 645541 not found.", "path": "/fee-merchant/v1/merchants/645541" }

Architecture

text
Consumer (BFF / Portal) │ ▼ ┌─────────────────────────────┐ │ FeeMerchantController │ REST layer — receives and validates HTTP requests └────────────┬────────────────┘ │ ▼ ┌─────────────────────────────┐ │ FeeMerchantService │ Business layer — orchestrates the upstream call, │ │ handles errors, and triggers mapping └────────────┬────────────────┘ │ RestTemplate (HTTP 600;">GET) ▼ ┌─────────────────────────────┐ │ Getnet Upstream API │ Internal fee management system (EstabelecimentoDTO) └────────────┬────────────────�� │ ▼ ┌─────────────────────────────┐ │ EstablishmentMapper │ MapStruct — converts EstabelecimentoDTO → EstablishmentDTO └────────────┬────────────────┘ │ ▼ HTTP 200 Response (EstablishmentDTO)

Technology Stack

TechnologyVersionPurpose
Java17Runtime language
Spring Boot3.5.14Application framework
Spring Boot ActuatorHealth, info, and metrics endpoints
Spring Boot ValidationBean Validation (Jakarta)
SpringDoc OpenAPI (Swagger)2.7.0API documentation & Swagger UI
MapStruct1.5.5.FinalDTO mapping
LombokBoilerplate reduction
Apache Tomcat Embed11.0.21Embedded web server
Logback1.5.19Structured logging
JUnit JupiterUnit testing

Observability (Spring Boot Actuator)

The following actuator endpoints are exposed at the application base path (/):
EndpointDescription
/healthLiveness and readiness probes, disk space, and upstream checks
/infoBuild metadata (groupId, artifactId, version, build date, Java & OS info)
/metricsApplication metrics
/envEnvironment properties (values shown when authorized)
/loggersRuntime log level management
/threaddumpActive thread dump
/mappingsAll registered request mappings
/beansAll Spring beans loaded in the application context
Health groups:
  • Liveness: livenessStatediskSpace
  • Readiness: readinessStatefeeMerchantUpstream

Environments

Swagger UI: {base-url}/swagger-ui.html OpenAPI JSON: {base-url}/api-docs

Running Locally

text
# Build the project mvn clean package -DskipTests # Run the application java -jar target/mng-fee-merchant-adp-2.0.3.jar --spring.profiles.active=dev
information icon
The application starts on port 8080 by default. Make sure the upstream Getnet API URL is configured in application-dev.yml under the app.host property.

Configuration

Key properties in application.yml:
PropertyDescription
server.portHTTP port (default: 8080)
server.servlet.context-pathAPI context path (/fee-merchant/v1)
app.hostUpstream Getnet API base URL
management.endpoints.web.base-pathActuator base path (default: /)

Contact

OrganizationGetnet
Websitewww.getnet.com.br
Support e-mailteste@getnet.com.br