Mercado Pago Payment API
Documentation for the FastAPI payment integration with Mercado Pago.
FastAPI + Mercado Pago
Online payments with a clear, secure, and fast flow
Central documentation for the payment project integrated with Mercado Pago. Find installation, configuration, endpoints, security, testing, and deployment in one place.
Overview
- :material-credit-card-check-outline: Unified checkout
Card, PIX, and boleto with a consistent front-end flow.
- :material-shield-check-outline: Built-in security
Token handling, input validation, and error handling in the integration.
- :material-flash-outline: Real-time response
Fast feedback to confirm transaction status.
- :material-api: Structured REST integration
Separate endpoints for checkout, lookup, and operations.
Documentation Index
- Getting Started
Install the project, configure your environment, and run the API locally.
Installation
Configuration
Development
- API & Security
Review the request flow, endpoint reference, and security guidance.
API Endpoints
Authentication and Security
System Modeling
- Quality & Delivery
Standards, testing, deployment, and release notes.
Guidelines and Standards
Testing
Deploy
Contributing
Release Notes
Quick Start
git clone https://github.com/GabrielDLobo/06-API_Pgto_MercadoLivre.git
cd 06-API_Pgto_MercadoLivre
pip install -r requirements.txt
uvicorn app:app --reload --host 0.0.0.0 --port 8000
::: details Interactive API docs
- Swagger UI:
http://localhost:8000/docs - ReDoc:
http://localhost:8000/redoc
:::
Browse the documentation
- Installation and setup
Installation
Configuration
Development
- Architecture and API
API Endpoints
Authentication and Security
System Modeling
- Best practices and operations
Guidelines and Standards
Testing
Deploy
- Contribution and history
Payment Flow
sequenceDiagram
participant User
participant Frontend
participant API
participant MercadoPago
User->>Frontend: Selects payment method
Frontend->>API: POST /create_payment
API->>MercadoPago: Creates charge
MercadoPago-->>API: Returns status
API-->>Frontend: Transaction result
Frontend->>User: Shows confirmation
## Tech Stack
| Layer | Technology |
|---|---|
| Backend | FastAPI 0.115.12 |
| Server | Uvicorn 0.34.2 |
| Validation | Pydantic 2.11.4 |
| HTTP Client | Requests 2.32.3 |
| Templates | Jinja2 3.1.6 |
| Configuration | python-decouple 3.8 |
## Useful Shortcuts
Local docs: `mkdocs serve -a 127.0.0.1:8001`
Local API: `uvicorn app:app --reload --host 0.0.0.0 --port 8000`