TheDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/Hansel-Pan/sistema-de-informacion-web-para-un-gimnasio/llms.txt
Use this file to discover all available pages before exploring further.
/api/pagos resource records membership fee payments made by gym clients. When a payment is created, the backend calculates the total charge based on the number of days contracted. All historical payment records are preserved and can be listed at any time.
GET /api/pagos
Returns an array of all payment records, ordered by most recent first.Response fields
Unique identifier for the payment record.
Full name of the client who made the payment.
National ID or document number of the client.
Date the payment was recorded, in ISO 8601 format (e.g.
2024-03-10).Number of membership days purchased in this payment.
Total amount charged for this payment in Colombian pesos (COP). The frontend reads this field as
Number(p.total), so the value may be returned as a string by the API.Example request
Example response
POST /api/pagos
Creates a new payment record for a client.The frontend re-fetches the full client list immediately after a successful payment, and clients display an updated
dias_restantes value — suggesting the backend increments the client’s day balance when a payment is created. Confirm this side effect in your backend implementation.Request body
The unique ID of the client making the payment. Must correspond to an existing client.
The date of the payment in ISO 8601 format (
YYYY-MM-DD).Number of membership days being purchased. Accepted range:
1–365.Pricing logic
Thetotal stored in the payment record is computed server-side using the following pricing tiers, which mirror the calcularTotal() function in Pagos.jsx:
| Days contracted | Price (COP) |
|---|---|
| 365 | $1,000,000 |
| 30 | $90,000 |
| 15 | $50,000 |
| 1 – 14 | days × $8,000 |
Response fields
Unique identifier for the newly created payment record.
Full name of the client associated with this payment.
National ID or document number of the client.
Date of the payment in ISO 8601 format.
Number of days purchased.
Computed total amount charged (COP). The frontend reads this as
Number(p.total), so the API may return this value as a string.