Version 1.0.0
API for managing clinics, plans, and payments.
| Method | Path | Description |
|---|---|---|
| DELETE | /deleteClinic/{id} | Delete a clinic by ID |
| DELETE | /deletePayment/{id} | Delete a payment by ID |
| GET | /getClinicById/{id} | Get a clinic by ID |
| GET | /getPaymentById/{id} | Get a payment by ID |
| GET | /obtainAllClinics | Retrieve all clinics |
| GET | /obtainAllPayments | Retrieve all payments |
| GET | /obtainAllPlans | Retrieve all plans |
| GET | /obtainPlanById/{id} | Retrieve a plan by ID |
| POST | /payment | Process a payment |
| POST | /registerClinic | Register a new clinic |
| POST | /registerPayment | Register a new payment |
| PUT | /updateClinic/{id} | Update a clinic by ID |
| Name | Path | Description |
|---|---|---|
| Clinic | #/components/schemas/Clinic | |
| Payment | #/components/schemas/Payment | |
| Plan | #/components/schemas/Plan |
-
Summary
Delete a clinic by ID -
Description
Deletes a specific clinic by its unique ID.
-
204 Clinic successfully deleted
-
404 Clinic not found
-
Summary
Delete a payment by ID -
Description
Deletes a specific payment by its unique ID.
-
204 Payment successfully deleted
-
404 Payment not found
-
Summary
Get a clinic by ID -
Description
Retrieve a specific clinic by its unique ID.
- 200 Clinic found
application/json
{
// Unique identifier for the clinic
_id?: string
// Name of the clinic
name?: string
// City where the clinic is located
city?: string
// District of the clinic
district?: string
// Subscription plan of the clinic
plan?: string
// Status of the clinic
active?: boolean
// Postal code of the clinic
postalCode?: string
// ISO 3166-1 alpha-2 country code
countryCode?: string
}- 404 Clinic not found
-
Summary
Get a payment by ID -
Description
Retrieve a specific payment by its unique ID.
- 200 Payment found
application/json
{
// Unique identifier for the payment
_id?: string
// Date of the payment
date?: string
// UUID of the clinic associated with the payment
clinicId?: string
// Status of the payment
status?: enum[Pending, Completed, Failed]
// UUID of the plan associated with the payment
planId?: string
}- 404 Payment not found
-
Summary
Retrieve all clinics -
Description
Returns a list of all registered clinics.
- 200 List of clinics
application/json
{
// Unique identifier for the clinic
_id?: string
// Name of the clinic
name?: string
// City where the clinic is located
city?: string
// District of the clinic
district?: string
// Subscription plan of the clinic
plan?: string
// Status of the clinic
active?: boolean
// Postal code of the clinic
postalCode?: string
// ISO 3166-1 alpha-2 country code
countryCode?: string
}[]-
Summary
Retrieve all payments -
Description
Returns a list of all registered payments.
- 200 List of payments
application/json
{
// Unique identifier for the payment
_id?: string
// Date of the payment
date?: string
// UUID of the clinic associated with the payment
clinicId?: string
// Status of the payment
status?: enum[Pending, Completed, Failed]
// UUID of the plan associated with the payment
planId?: string
}[]-
Summary
Retrieve all plans -
Description
Returns a list of all registered plans.
- 200 List of plans
application/json
{
// Unique identifier for the plan
_id?: string
// Name of the plan
name?: string
// Price of the plan
price?: number
features?: string[]
}[]-
Summary
Retrieve a plan by ID -
Description
Retrieves details of a specific plan by its unique ID.
- path
- name: id in: path required: true description: Unique identifier for the plan schema: type: string
- 200 Plan successfully retrieved
application/json
{
"_id": "string",
"name": "string",
"price": 0,
"features": ["string"]
}
- 404 Plan not found
- 400 Missing plan ID
***
### [POST]/payment
- Summary
Process a payment
- Description
Endpoint to process a payment, save the payment data, and activate the clinic.
#### RequestBody
- application/json
```ts
{
// ID of the clinic making the payment.
clinicId?: string
// ID of the plan being paid for.
planId?: string
}- 200 Payment processed successfully.
application/json
{
message?: string
// Information about the payment intent created by Stripe.
paymentIntent: {
}
}- 400 Error processing payment.
application/json
{
error?: string
}- 404 Plan not found.
application/json
{
error?: string
}-
Summary
Register a new clinic -
Description
Creates a new clinic and saves it in the database.
- application/json
{
// Name of the clinic
name: string
// City where the clinic is located
city: string
// District of the clinic
district: string
// Subscription plan of the clinic
plan: string
// Status of the clinic
active: boolean
// Postal code of the clinic
postalCode: string
// ISO 3166-1 alpha-2 country code
countryCode: string
}-
201 Clinic successfully created
-
400 Invalid input data
-
Summary
Register a new payment -
Description
Creates a new payment and saves it in the database.
- application/json
{
// Date of the payment
date: string
// UUID of the clinic
clinicId: string
// Status of the payment
status: enum[Pending, Completed, Failed]
// UUID of the plan
planId: string
}-
201 Payment successfully created
-
400 Invalid input data
-
Summary
Update a clinic by ID -
Description
Updates a clinic's details based on its unique ID.
- application/json
{
// Updated name of the clinic
name?: string
// Updated city where the clinic is located
city?: string
// Updated district of the clinic
district?: string
// Updated subscription plan of the clinic
plan?: string
// Updated status of the clinic
active?: boolean
// Updated postal code of the clinic
postalCode?: string
// Updated ISO 3166-1 alpha-2 country code
countryCode?: string
}- 200 Clinic successfully updated
application/json
{
// Unique identifier for the clinic
_id?: string
// Name of the clinic
name?: string
// City where the clinic is located
city?: string
// District of the clinic
district?: string
// Subscription plan of the clinic
plan?: string
// Status of the clinic
active?: boolean
// Postal code of the clinic
postalCode?: string
// ISO 3166-1 alpha-2 country code
countryCode?: string
}-
400 Invalid input data
-
404 Clinic not found
{
// Unique identifier for the clinic
_id?: string
// Name of the clinic
name?: string
// City where the clinic is located
city?: string
// District of the clinic
district?: string
// Subscription plan of the clinic
plan?: string
// Status of the clinic
active?: boolean
// Postal code of the clinic
postalCode?: string
// ISO 3166-1 alpha-2 country code
countryCode?: string
}{
// Unique identifier for the payment
_id?: string
// Date of the payment
date?: string
// UUID of the clinic associated with the payment
clinicId?: string
// Status of the payment
status?: enum[Pending, Completed, Failed]
// UUID of the plan associated with the payment
planId?: string
}{
// Unique identifier for the plan
_id?: string
// Name of the plan
name?: string
// Price of the plan
price?: number
features?: string[]
}