Of course. Here are a few examples, ranging from simple to more complex and realistic.
1. Simple Example
This is a basic JSON object representing a customer's core profile.
{
"customerId": "CUST-84321",
"firstName": "Jane",
"lastName": "Doe",
"email": "jane.doe@example.com",
"memberSince": "2018-05-21",
"accounts": [
{
"accountNumber": "XXXX-XXXX-XXXX-1234",
"accountType": "Checking",
"balance": 5430.50
},
{
"accountNumber": "XXXX-XXXX-XXXX-5678",
"accountType": "Savings",
"balance": 27812.15
}
]
}
2. Detailed Example (More Realistic API Response)
This example is structured like a typical API response, with metadata and more detailed, nested information. This is closer to what you'd see in a real-world banking application.
{
"status": "success",
"requestId": "a1b2c3d4-e5f6-7890-1234-567890abcdef",
"timestamp": "2023-10-27T10:30:00Z",
"data": {
"customerProfile": {
"customerId": "89a4e09f-b39a-4c9b-9c7d-3d23f8f1a1a2",
"customerTier": "Preferred",
"status": "Active",
"memberSince": "2015-03-12",
"lastLogin": "2023-10-26T18:45:12Z",
"personalInfo": {
"firstName": "John",
"lastName": "Smith",
"dateOfBirth": "1985-11-05",
"contact": {
"email": "john.smith.bank@example.com",
"phone": {
"primary": "+15551234567",
"secondary": null
}
},
"address": {
"street": "123 Main Street",
"city": "Anytown",
"state": "CA",
"postalCode": "90210",
"country": "USA"
}
},
"preferences": {
"notifications": {
"emailEnabled": true,
"smsEnabled": false,
"pushEnabled": true
},
"paperlessStatements": true
}
},
"accounts": [
{
"accountId": "ACC-CHK-9876",
"accountNumberMasked": "********9876",
"accountType": "Checking",
"nickname": "Main Checking",
"status": "Active",
"currency": "USD",
"balance": {
"current": 4250.75,
"available": 4195.25
}
},
{
"accountId": "ACC-SAV-5432",
"accountNumberMasked": "********5432",
"accountType": "Savings",
"nickname": "Vacation Fund",
"status": "Active",
"currency": "USD",
"balance": {
"current": 15600.00,
"available": 15600.00
},
"interest": {
"rate": 1.25,
"ytdAccrued": 182.50
}
},
{
"accountId": "ACC-CC-1122",
"accountNumberMasked": "********1122",
"accountType": "Credit Card",
"nickname": "Rewards Card",
"status": "Active",
"currency": "USD",
"balance": {
"current": -850.40,
"availableCredit": 9149.60,
"creditLimit": 10000.00
},
"paymentDue": {
"date": "2023-11-15",
"minimumAmount": 25.00
}
}
]
}
}
Key Features of the Detailed Example:
- API Response Wrapper: The entire payload is wrapped in an object with
status, requestId, and timestamp for better logging and error handling.
- Nested Objects: Information is logically grouped (e.g.,
personalInfo, contact, address) for better organization and readability.
- Security: The
accountNumber is masked (********9876), which is a critical security best practice. A separate, non-public accountId is used for internal reference.
- Data Granularity:
balance is split into current and available to reflect pending transactions. Credit cards have availableCredit and creditLimit.
- Enums/Standard Values: Fields like
status ("Active") and accountType ("Checking") use standardized string values.
- Standard Formats: Timestamps use the ISO 8601 format, which is a universal standard.
- Null Values: Shows how
null can be used to indicate the absence of data (e.g., a secondary phone number).