Endpoint
Description
Registers a new payment record in the system. This endpoint stores payment information after a successful payment has been processed through a payment provider like Mercado Pago.This endpoint is typically called after receiving a webhook notification from the payment provider, not directly by client applications.
server/src/modules/payments/payments.controller.ts:13-23.
Authentication
This endpoint requires Bearer token authentication. Include your access token in the
Authorization header.Request Body
Unique identifier from the payment provider (e.g., Mercado Pago payment ID)Example:
1234567890ID of the reservation associated with this paymentExample:
res_abc123Payment amountExample:
5000Currency code (e.g., ARS, USD)Example:
ARSPayment status from the providerExample:
approvedPayment method usedExample:
credit_cardEmail of the person who made the paymentExample:
[email protected]Example Request Body
Response
Unique identifier for the payment record in Zenda’s database
Payment provider’s payment ID
Associated reservation ID
Payment amount
Currency code
Payment status
Payment method used
Payer’s email address
Timestamp when the payment record was created
Success Response (201)
Error Responses
400 Bad Request
401 Unauthorized
Code Examples
Payment Flow
Payment Preference Created
First, a payment preference is created via
POST /api/reservations/paymentUse Cases
- Recording successful payment transactions
- Storing payment provider references
- Tracking payment methods and amounts
- Linking payments to reservations
- Maintaining payment audit trail
Related Endpoints
Create Payment Preference
Generate a payment preference for Mercado Pago
Create With Payment
Create reservation after payment confirmation
Mercado Pago Integration
Learn about the payment integration