A Spring Boot-based REST API service for Billio payment processing and barcode generation.
Billio API is designed to provide backend services for the Billio payment platform. The API enables:
- Generation of 2D payment barcodes (PDF417) for invoices
- Secure authentication using JWT tokens from Supabase
- RESTful endpoints for payment processing
The primary focus is on providing a robust, secure, and scalable backend for payment processing applications.
This project is built using the following technologies:
- Spring Boot 3.4.4: Modern Java framework for building web applications
- Spring Security: For authentication and authorization
- Spring MVC: For building RESTful endpoints
- Auth0 Java JWT (4.3.0): For JWT token validation
- Supabase Authentication: For user management and token issuance
- ZXing (3.3.0): For generating PDF417 barcodes
- SpringDoc OpenAPI (2.3.0): For API documentation with Swagger UI
- Jakarta Validation API (3.0.2): For request validation
- Java 17 or higher
- Maven 3.6 or higher
- Supabase account (for authentication)
Both variables are required; the application will not start without them:
SUPABASE_JWT_SECRET=your-jwt-secret-from-supabase
SUPABASE_JWT_ISSUER=https://your-project-ref.supabase.co/auth/v1
-
Clone the repository:
git clone https://github.com/eon-ideas/billio-api-public.git cd billio-api-public -
Build the project:
./mvnw clean install
-
Run the application in development mode:
./mvnw spring-boot:run
-
The API will be available at:
- Base URL: http://localhost:8080
- Swagger UI: http://localhost:8080/swagger-ui.html
- OpenAPI Docs: http://localhost:8080/api-docs
You can test the API using the Swagger UI or with tools like curl or Postman:
# Example: Generate a barcode for invoice with ID 1
curl -X POST \
http://localhost:8080/invoices/1/2d-barcode.png \
-H 'Authorization: Bearer your-jwt-token' \
-H 'Content-Type: application/json' \
-d '{
"amount": 100.00,
"recipientName": "Company Name",
"iban": "HR1210010051863000160",
"model": "HR00",
"callNumber": "123456-789",
"description": "Invoice payment"
}'To generate a barcode from the deployed API and save it locally:
curl -X 'POST' \
'https://<your-deployment-host>/invoices/6d9fd9ed-0ee8-4f2a-ba9a-23c36f78eeec/2d-barcode.png' \
-H 'accept: image/png' \
-H 'Authorization: Bearer YOUR_TOKEN' \
-H 'Content-Type: application/json' \
--output barcode.png \
-d '{
"amount": 2050.00,
"recipientName": "Company Name",
"recipientAddress": {
"street": "Example Street",
"houseNumber": "1",
"city": {
"name": "Zagreb",
"postalCode": "10000"
}
},
"iban": "HR1210010051863000160",
"model": "99",
"callNumber": "1-1-1",
"description": "Invoice 1-1-1"
}'-
Build the production JAR:
./mvnw clean package
-
The production-ready JAR will be available in the
targetdirectory.
-
Run the JAR with production configuration:
java -jar target/billio-api-0.0.1-SNAPSHOT.jar
-
For production deployment, consider:
- Using a process manager like systemd
- Setting up HTTPS with a reverse proxy (Nginx, Apache)
- Configuring proper logging
- Setting up monitoring
- JWT tokens are validated for signature, issuer, and audience
- All API endpoints under
/invoicesrequire authentication - Sensitive configuration should be provided via environment variables
- Consider implementing rate limiting for production use
For more detailed information about the API endpoints, refer to the Swagger UI documentation available at /swagger-ui.html when the application is running.
For support, contact Billio Support at support@eonideas.hr or visit our website at https://eon-billio.netlify.app.
This project is licensed under the MIT License. See LICENSE.