Overview
The Payments API enables payment processing for reservations in the Zenda system. It handles payment creation and preference generation for payment providers like MercadoPago.Base Endpoint
Available Endpoints
Create Payment
Register a payment in the system
Create Preference
Generate a payment preference for providers
Payment Object
Payments in the system follow this structure:Payment Flow
The typical payment workflow:- Create Preference: Generate a payment preference with reservation details
- Process Payment: User completes payment with the payment provider (e.g., MercadoPago)
- Create Payment Record: Register the payment in Zenda
- Create Reservation: Create the reservation with payment attached
Payment Status
Payments can have the following statuses:PENDING- Payment initiated but not completedPAID- Payment successfully processedFAILED- Payment failed or was rejected
Payment Providers
Zenda currently supports:- MercadoPago - Primary payment provider
- Additional providers can be integrated
Authentication
All payment endpoints require Bearer token authentication.Key Concepts
Payment Preference
A payment preference is a configuration object sent to the payment provider containing:- Reservation details
- Amount to charge
- Success/failure callback URLs
- Customer information
External Payment ID
When a payment is processed through a provider like MercadoPago, they assign an external ID. This ID is stored in theexternal_payment_id field to link our payment record with the provider’s transaction.
Related Features
Professional Settings
Payment requirements are configured in Professional Settings:requires_deposit- Whether payment is requireddeposit_amount- Amount to charge
Reservations
Payments are closely tied to reservations:- Create With Payment - Create reservation with payment
- Create Without Payment - Skip payment if not required
Use Cases
- Process deposits for appointment bookings
- Generate payment links for clients
- Track payment status and history
- Integrate with payment providers
- Handle payment confirmations and failures
Security Considerations
- All payment operations require authentication
- Payment amounts should be validated against professional settings
- External payment IDs should be verified with the provider
- Sensitive payment data is handled by the payment provider (PCI compliance)
Next Steps
Create Preference
Learn how to generate payment preferences
Create Payment
Learn how to register payments