These APIs allows you to manage credit card limits and offers for customers.
One-to-One Multiplicity && Uni-directional Association
- Each
LimitOffer
corresponds to a singleAccount
. - Each
Account
can have multiple associatedLimitOffers
. - Given a
LimitOffer
, you can access the associatedAccount
. - However, a direct reference from an
Account
to its associatedLimitOffers
might not be present.
Request:
curl --location 'http://localhost:8080/v1/accounts' \
--header 'Content-Type: application/json' \
--data '{
"customerId": 1432667,
"accountLimit": 200000.0,
"perTransactionLimit": 40000.0
}'
Response:
{
"accountLimit": 200000.0,
"perTransactionLimit": 40000.0
}
Request:
curl --location 'http://localhost:8080/v1/accounts/{accountId}
Response:
{
"accountLimit": 200000.0,
"perTransactionLimit": 80000.0
}
Request:
curl --location 'http://localhost:8080/v1/limit-offers' \
--header 'Content-Type: application/json' \
--data '{
"accountId": 7,
"limitType": "ACCOUNT_LIMIT",
"newLimit": 800000.0,
"offerActivationTime": "2023-08-07T10:00:00",
"offerExpiryTime": "2023-08-15T23:59:59"
}'
Response:
LimitOffer
{
"accountId": 7,
"limitType": "ACCOUNT_LIMIT",
"newLimit": 800000.0,
"offerActivationTime": "2023-08-07T10:00:00",
"offerExpiryTime": "2023-08-15T23:59:59"
}
Request:
curl --location 'http://localhost:8080/v1/limit-offers/active/{accountId}'
Response:
[
{
"accountId": 7,
"limitType": "ACCOUNT_LIMIT",
"newLimit": 800000.0,
"offerActivationTime": "2023-08-07T10:00:00",
"offerExpiryTime": "2023-08-15T23:59:59"
}
]
Request:
curl --location --request PUT 'http://localhost:8080/v1/limit-offers/{limitOfferId}/status' \
--header 'Content-Type: application/json' \
--data '{
"status": "ACCEPTED"
}'
Response:
{
"accountId": 7,
"limitType": "ACCOUNT_LIMIT",
"newLimit": 800000.0,
"offerActivationTime": "2023-08-08T10:00:00",
"offerExpiryTime": "2023-08-15T23:59:59"
}