Credit Accounts API
This API allows managing Credit Accounts in the system. It provides endpoints to retrieve, update, and manage reservations in customers' credit accounts.
The Credit Account Object
The Credit Account object represents a credit account associated with a customer and a specific product type.
Attributes
| Attribute | Description | Type |
|---|---|---|
clientId | ID of the customer associated with the account | String (UUID) |
partnerId | ID of the partner associated with the account | String (UUID) |
creditLine | Details of the credit line | Object |
productFamily | Type of financial product | String |
status | Status of the credit account | String |
createdAt | Date and time of account creation | String (ISO 8601) |
updatedAt | Date and time of last account update | String (ISO 8601) |
The Credit Line Details Object
The Credit Line Details object provides detailed information about a credit line of an account.
Attributes
| Attribute | Description | Type |
|---|---|---|
assigned | Total amount assigned to the credit line | Object (Money) |
available | Available amount in the credit line | Object (Money) |
consumed | Consumed amount of the credit line | Object (Money) |
reservations | List of reservations in the credit line | Array of Object |
The Reservation Object
The Reservation object represents a credit reservation in an account.
Attributes
| Attribute | Description | Type |
|---|---|---|
productFamily | Type of financial product | String |
sourceId | ID of the reservation source | String (UUID) |
sourceType | Type of reservation source | String |
amount | Amount of the reservation | Object (Money) |
status | Status of the reservation | String |
createdAt | Date and time of reservation creation | String (ISO 8601) |
Endpoints
Get a Customer's Credit Account
Retrieves the credit account information of a customer for a specific product type.
Path Parameters:
| Parameter | Description |
|---|---|
client_id | Customer ID |
product_family | Type of financial product |
Query Parameters:
| Parameter | Description | Type | Required |
|---|---|---|---|
include | Additional fields to include | String | No |
Successful Response:
The response will be a Credit Account object.
List Credit Accounts of Multiple Customers
Retrieves the credit account information of different customers for a specific product type.
Path Parameters:
| Parameter | Description |
|---|---|
product_family | Type of financial product |
Query Parameters:
| Parameter | Description | Type |
|---|---|---|
include | Additional fields to include (history or reservations) | String |
partner | Filter by partner ID | String |
status | Filter by customer status | String |
sort-by | Field to sort by | String |
sort-direction | Sorting direction (asc or desc) | String |
page | Page number | Integer |
per-page | Items per page | Integer |
Successful Response:
The response will be a list of Credit Account.
Update a Customer's Credit Account
Updates the assigned credit line for a customer for a specific product type.
Path Parameters:
| Parameter | Description |
|---|---|
client_id | Customer ID |
product_family | Type of financial product |
Request Body:
Input Parameters:
| Parameter | Description | Type | Required |
|---|---|---|---|
assigned | New assigned amount | Object (Money) | Yes |
reason | Reason for the credit line change | String | No |
Successful Response:
The response will be the updated Credit Account object.
List Reservations of a Credit Account
Retrieves a list of reservations in a customer's credit account.
Path Parameters:
| Parameter | Description |
|---|---|
client_id | Customer ID |
product_family | Type of financial product |
Successful Response:
Add a Reservation to a Credit Account
Adds a new reservation to a customer's credit account.
Path Parameters:
| Parameter | Description |
|---|---|
client_id | Customer ID |
product_family | Type of financial product |
Request Body:
Input Parameters:
| Parameter | Description | Type | Required |
|---|---|---|---|
amount | Amount of the reservation | Object (Money) | Yes |
sourceType | Type of reservation source | String | Yes |
sourceId | ID of the reservation source | String (UUID) | Yes |
Successful Response:
Status code 204 (No Content) if the reservation was successfully added.
Delete a Reservation from a Credit Account
Deletes an existing reservation from a customer's credit account.
Path Parameters:
| Parameter | Description |
|---|---|
client_id | Customer ID |
product_family | Type of financial product |
source_id | ID of the reservation source |
Successful Response:
Status code 204 (No Content) if the reservation was successfully deleted.
Update a Reservation in a Credit Account
Updates an existing reservation in a customer's credit account.
Path Parameters:
| Parameter | Description |
|---|---|
client_id | Customer ID |
product_family | Type of financial product |
source_id | ID of the reservation source |
Request Body:
Input Parameters:
| Parameter | Description | Type | Required |
|---|---|---|---|
amount | New amount of the reservation | Object (Money) | Yes |
sourceType | Type of reservation source | String | Yes |
Successful Response:
Status code 204 (No Content) if the reservation was successfully updated.
Confirm a Reservation in a Credit Account
Confirms a pending reservation in a customer's credit account.
Path Parameters:
| Parameter | Description |
|---|---|
client_id | Customer ID |
product_family | Type of financial product |
source_id | ID of the reservation source |
Successful Response:
Status code 204 (No Content) if the reservation was successfully confirmed.
Error Handling
The API may return the following error codes:
| Code | Description |
|---|---|
| 400 | Bad Request |
| 401 | Unauthorized |
| 403 | Forbidden |
| 404 | Not Found |
| 500 | Internal Server Error |
Errors will include a descriptive message in the response body.