Download OpenAPI specification:Download
This is a sample Spring Boot RESTful service using springdoc-openapi and OpenAPI 3.
Returns a list of all payments.
Sample curl command:
curl -X GET "http://localhost:8080/api/payments" \
-H "accept: application/json"
{- "id": 5001,
- "customerId": 1,
- "invoiceId": 1001,
- "amount": 199.99,
- "method": "Credit Card",
- "status": "COMPLETED",
- "date": "2023-12-01"
}
Creates a new payment.
Sample curl command:
curl -X POST "http://localhost:8080/api/payments" \
-H "accept: application/json" \
-H "Content-Type: application/json" \
-d '{
"customerId":1,
"invoiceId":1001,
"amount":199.99,
"method":"Credit Card",
"status":"COMPLETED",
"date":"2023-12-01"
}'
Payment to be added
id | integer <int64> Unique identifier of the payment |
customerId | integer <int64> Customer ID associated with the payment |
invoiceId | integer <int64> Invoice ID associated with the payment |
amount | number <double> Amount of the payment |
method | string Payment method |
status | string Payment status |
date | string Payment date |
{- "id": 5001,
- "customerId": 1,
- "invoiceId": 1001,
- "amount": 199.99,
- "method": "Credit Card",
- "status": "COMPLETED",
- "date": "2023-12-01"
}
{- "id": 5001,
- "customerId": 1,
- "invoiceId": 1001,
- "amount": 199.99,
- "method": "Credit Card",
- "status": "COMPLETED",
- "date": "2023-12-01"
}
Returns a list of all payments associated with a specific customer.
Sample curl command:
curl -X GET "http://localhost:8080/api/customers/1/payments" \
-H "accept: application/json"
customerId required | string Example: 1 ID of the customer to retrieve payments for |
{- "id": 5001,
- "customerId": 1,
- "invoiceId": 1001,
- "amount": 199.99,
- "method": "Credit Card",
- "status": "COMPLETED",
- "date": "2023-12-01"
}
Returns a list of all invoices.
Sample curl command:
curl -X GET "http://localhost:8080/api/invoices" \
-H "accept: application/json"
{- "id": 1001,
- "customerId": 1,
- "amount": 199.99,
- "status": "PAID",
- "dueDate": "2023-12-31",
- "description": "Monthly subscription fee"
}
Creates a new invoice.
Sample curl command:
curl -X POST "http://localhost:8080/api/invoices" \
-H "accept: application/json" \
-H "Content-Type: application/json" \
-d '{
"customerId":1,
"amount":199.99,
"status":"PAID",
"dueDate":"2023-12-31",
"description":"Monthly subscription fee"
}'
Invoice to be added
id | integer <int64> Unique identifier of the invoice |
customerId | integer <int64> Customer ID associated with the invoice |
amount | number <double> Amount of the invoice |
status | string Status of the invoice |
dueDate | string Due date of the invoice |
description | string Description of the invoice |
{- "id": 1001,
- "customerId": 1,
- "amount": 199.99,
- "status": "PAID",
- "dueDate": "2023-12-31",
- "description": "Monthly subscription fee"
}
{- "id": 1001,
- "customerId": 1,
- "amount": 199.99,
- "status": "PAID",
- "dueDate": "2023-12-31",
- "description": "Monthly subscription fee"
}
Returns a list of all invoices associated with a specific customer.
Sample curl command:
curl -X GET "http://localhost:8080/api/customers/1/invoices" \
-H "accept: application/json"
customerId required | string Example: 1 ID of the customer to retrieve invoices for |
{- "id": 1001,
- "customerId": 1,
- "amount": 199.99,
- "status": "PAID",
- "dueDate": "2023-12-31",
- "description": "Monthly subscription fee"
}
Returns a list of all registered customers.
Sample curl command:
curl -X GET "http://localhost:8080/api/customers" \
-H "accept: application/json"
{- "id": 1,
- "name": "John Doe",
- "email": "john.doe@example.com",
- "phone": "+1234567890",
- "addresses": [
- {
- "street": "123 Main St",
- "city": "Springfield",
- "state": "IL",
- "postalCode": "62701",
- "country": "USA"
}
]
}
Creates a new customer.
Sample curl command:
curl -X POST "http://localhost:8080/api/customers" \
-H "accept: application/json" \
-H "Content-Type: application/json" \
-d '{
"name":"Taro Yamada",
"email":"taro.yamada@example.com",
"phone":"+819012345678",
"addresses":[
{
"street":"123 Main St",
"city":"Tokyo",
"state":"Tokyo",
"postalCode":"100-0001",
"country":"Japan"
}
]
}'
Customer to be added
id | integer <int64> Unique identifier of the customer |
name | string Name of the customer |
string Email of the customer | |
phone | string Customer's phone number |
Array of objects (Address) List of addresses associated with the customer |
{- "id": 1,
- "name": "John Doe",
- "email": "john.doe@example.com",
- "phone": "+1234567890",
- "addresses": [
- {
- "street": "123 Main St",
- "city": "Springfield",
- "state": "IL",
- "postalCode": "62701",
- "country": "USA"
}
]
}
{- "id": 1,
- "name": "John Doe",
- "email": "john.doe@example.com",
- "phone": "+1234567890",
- "addresses": [
- {
- "street": "123 Main St",
- "city": "Springfield",
- "state": "IL",
- "postalCode": "62701",
- "country": "USA"
}
]
}