Endpoint: POST /api/v1/register
Description: Registers a new user in the system.
Request:
curl -X POST \
-H "Content-Type: application/json" \
-d '{
"first_name": "string",
"last_name": "string",
"email": "string (valid email format)",
"pin": "string (4 digits)"
}' \
http://bankfacilito.xyz/api/v1/register -i
Example Response:
{
"message": "User registered successfully",
"token": "string (JWT Token)",
"user": {
"id": "integer",
"first_name": "string",
"last_name": "string",
"email": "string"
},
"account": {
"account_number": "string",
"balance": "float"
}
}
Endpoint: POST /api/v1/login
Description: Authenticates a user and provides an access token.
Request:
curl -X POST \
-H "Content-Type: application/json" \
-d '{
"account_number": "integer",
"pin": "string (4 digits)"
}' \
http://bankfacilito.xyz/api/v1/login -i
Example Response:
{
"token": "string (JWT Token)"
}
Endpoint: PUT /api/v1/users/{id}/
Description: Updates user information.
Request:
curl -X PUT \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <JWT Token>" \
-d '{
"first_name": "string",
"last_name": "string",
"email": "string (valid email format)"
}' \
http://bankfacilito.xyz/api/v1/users/{id}/ -i
Example Response:
{
"id": "integer",
"first_name": "string",
"last_name": "string",
"email": "string"
}
Endpoint: GET /api/v1/accounts
Description: Retrieves all accounts for the authenticated user.
Request:
curl -X GET \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <JWT Token>" \
http://bankfacilito.xyz/api/v1/accounts -i
Example Response:
[
{
"id": "integer",
"user_id": "integer",
"account_number": "string",
"clabe": "string",
"balance": "float"
}
]
Endpoint: POST /api/v1/accounts
Description: Creates a new account for the authenticated user.
Request:
curl -X POST \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <JWT Token>" \
http://bankfacilito.xyz/api/v1/accounts/ -i
Example Response:
{
"id": "integer",
"user_id": "integer",
"account_number": "string",
"balance": "float",
"clabe": "string",
"created_at": "datetime",
"updated_at": "datetime",
"default": "boolean",
"account_type": "string"
}
Endpoint: GET /api/v1/accounts/{account_id}
Description: Retrieves details of a specific account.
Request:
curl -X GET \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <JWT Token>" \
http://bankfacilito.xyz/api/v1/accounts/{account_id} -i
Example Response:
{
"id": "integer",
"user_id": "integer",
"account_number": "string",
"balance": "float",
"clabe": "string",
"created_at": "datetime",
"updated_at": "datetime",
"default": "boolean",
"account_type": "string"
}
Endpoint: POST /api/v1/recipients
Description: Adds a recipient for fund transfers.
Request:
curl -X POST \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <JWT Token>" \
-d '{
"recipient": {
"clabe": "string",
"name": "string"
}
}' \
http://bankfacilito.xyz/api/v1/recipients/ -i
Example Response:
{
"id": "integer",
"user_id": "integer",
"name": "string",
"account_id": "integer",
"created_at": "datetime",
"updated_at": "datetime"
}
Endpoint: GET /api/v1/recipients
Description: Retrieves all recipients for the authenticated user.
Request:
curl -X GET \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <JWT Token>" \
http://bankfacilito.xyz/api/v1/recipients/ -i
Example Response:
[
{
"id": "integer",
"name": "string",
"account_id": "integer"
}
]
Endpoint: DELETE /api/v1/recipients/{id}
Description: Deletes a specific recipient.
Request:
curl -X DELETE \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <JWT Token>" \
http://bankfacilito.xyz/api/v1/recipients/{id} -i
Endpoint: GET /api/v1/services
Description: Retrieves all available services.
Request:
curl -X GET \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <JWT Token>" \
http://bankfacilito.xyz/api/v1/services/ -i
Endpoint: GET /api/v1/accounts/{account_id}/transactions
Description: Retrieves all transactions for a specific account.
Request:
curl -X GET \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <JWT Token>" \
http://bankfacilito.xyz/api/v1/accounts/{account_id}/transactions -i
Endpoint: POST /api/v1/accounts/{account_id}/transactions
Description: Creates a new transaction.
Request:
curl -X POST \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <JWT Token>" \
-d '{
"recipient_account_id": "integer",
"amount": "float",
"description": "string"
}' \
http://bankfacilito.xyz/api/v1/accounts/{account_id}/transactions -i
Example Response:
{
"message": "Transaction completed successfully",
"amount": "float",
"source_account": {
"account_number": "string"
},
"recipient_account": {
"account_number": "string"
}
}
Endpoint: POST /api/v1/accounts/{account_id}/pay_service
Description: Pays for a service using a specific account.
Request:
curl -X POST \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <JWT Token>" \
-d '{
"service_id": "integer",
"amount": "float",
"description": "string"
}' \
http://bankfacilito.xyz/api/v1/accounts/{account_id}/pay_service -i