AltScore
Credit Management System (CMS)

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.

{
    "clientId": "e732bc5f-5b84-4a0a-81b4-5354d4625a8b",
    "partnerId": "6457c3ce-3887-45d6-92ca-299219ea96db",
    "creditLine": {
        "assigned": {
            "amount": "100000.00",
            "currency": "ARS",
            "display": "$100,000.00"
        },
        "available": {
            "amount": "90000.00",
            "currency": "ARS",
            "display": "$90,000.00"
        },
        "consumed": {
            "amount": "10000.00",
            "currency": "ARS",
            "display": "$10,000.00"
        },
        "reservations": [
            {
                "productFamily": "bnpl",
                "sourceId": "a3a424c6-e34c-4519-933a-7e44fb016c40",
                "sourceType": "flow",
                "amount": {
                    "amount": "10000.00",
                    "currency": "ARS"
                },
                "status": "confirmed",
                "createdAt": "2021-01-01T00:00:00Z"
            }
        ]
    },
    "productFamily": "bnpl",
    "status": "enabled",
    "createdAt": "2021-01-01T00:00:00Z",
    "updatedAt": "2021-01-01T00:00:00Z"
}

Attributes

AttributeDescriptionType
clientIdID of the customer associated with the accountString (UUID)
partnerIdID of the partner associated with the accountString (UUID)
creditLineDetails of the credit lineObject
productFamilyType of financial productString
statusStatus of the credit accountString
createdAtDate and time of account creationString (ISO 8601)
updatedAtDate and time of last account updateString (ISO 8601)

The Credit Line Details Object

The Credit Line Details object provides detailed information about a credit line of an account.

{
    "assigned": {
        "amount": "100000.00",
        "currency": "ARS",
        "display": "$100,000.00"
    },
    "available": {
        "amount": "90000.00",
        "currency": "ARS",
        "display": "$90,000.00"
    },
    "consumed": {
        "amount": "10000.00",
        "currency": "ARS",
        "display": "$10,000.00"
    },
    "reservations": [
        {
            "productFamily": "bnpl",
            "sourceId": "a3a424c6-e34c-4519-933a-7e44fb016c40",
            "sourceType": "flow",
            "amount": {
                "amount": "10000.00",
                "currency": "ARS"
            },
            "status": "confirmed",
            "createdAt": "2021-01-01T00:00:00Z"
        }
    ]
}

Attributes

AttributeDescriptionType
assignedTotal amount assigned to the credit lineObject (Money)
availableAvailable amount in the credit lineObject (Money)
consumedConsumed amount of the credit lineObject (Money)
reservationsList of reservations in the credit lineArray of Object

The Reservation Object

The Reservation object represents a credit reservation in an account.

{
    "productFamily": "bnpl",
    "sourceId": "a3a424c6-e34c-4519-933a-7e44fb016c40",
    "sourceType": "flow",
    "amount": {
        "amount": "10000.00",
        "currency": "ARS"
    },
    "status": "confirmed",
    "createdAt": "2021-01-01T00:00:00Z"
}

Attributes

AttributeDescriptionType
productFamilyType of financial productString
sourceIdID of the reservation sourceString (UUID)
sourceTypeType of reservation sourceString
amountAmount of the reservationObject (Money)
statusStatus of the reservationString
createdAtDate and time of reservation creationString (ISO 8601)

Endpoints

Get a Customer's Credit Account

Retrieves the credit account information of a customer for a specific product type.

GET /v2/clients/:client_id/credit-accounts/:product_family

Path Parameters:

ParameterDescription
client_idCustomer ID
product_familyType of financial product

Query Parameters:

ParameterDescriptionTypeRequired
includeAdditional fields to includeStringNo

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.

GET /v2/clients/credit-accounts/:product_family

Path Parameters:

ParameterDescription
product_familyType of financial product

Query Parameters:

ParameterDescriptionType
includeAdditional fields to include (history or reservations)String
partnerFilter by partner IDString
statusFilter by customer statusString
sort-byField to sort byString
sort-directionSorting direction (asc or desc)String
pagePage numberInteger
per-pageItems per pageInteger

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.

PATCH /v2/clients/:client_id/credit-accounts/:product_family

Path Parameters:

ParameterDescription
client_idCustomer ID
product_familyType of financial product

Request Body:

{
    "assigned": {
        "amount": "150000.00",
        "currency": "ARS"
    },
    "reason": "Increase due to good behaviour"
}

Input Parameters:

ParameterDescriptionTypeRequired
assignedNew assigned amountObject (Money)Yes
reasonReason for the credit line changeStringNo

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.

GET /v2/clients/:client_id/credit-accounts/:product_family/reservations

Path Parameters:

ParameterDescription
client_idCustomer ID
product_familyType of financial product

Successful Response:

[
    {
        "productFamily": "bnpl",
        "sourceId": "a3a424c6-e34c-4519-933a-7e44fb016c40",
        "sourceType": "flow",
        "amount": {
            "amount": "10000.00",
            "currency": "ARS"
        },
        "status": "confirmed",
        "createdAt": "2021-01-01T00:00:00Z"
    }
]

Add a Reservation to a Credit Account

Adds a new reservation to a customer's credit account.

POST /v2/clients/:client_id/credit-accounts/:product_family/reservations

Path Parameters:

ParameterDescription
client_idCustomer ID
product_familyType of financial product

Request Body:

{
    "amount": {
        "amount": "5000.00",
        "currency": "ARS"
    },
    "sourceType": "flow",
    "sourceId": "b4b424c6-e34c-4519-933a-7e44fb016c41"
}

Input Parameters:

ParameterDescriptionTypeRequired
amountAmount of the reservationObject (Money)Yes
sourceTypeType of reservation sourceStringYes
sourceIdID of the reservation sourceString (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.

DELETE /v2/clients/:client_id/credit-accounts/:product_family/reservations/:source_id

Path Parameters:

ParameterDescription
client_idCustomer ID
product_familyType of financial product
source_idID 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.

PUT /v2/clients/:client_id/credit-accounts/:product_family/reservations/:source_id

Path Parameters:

ParameterDescription
client_idCustomer ID
product_familyType of financial product
source_idID of the reservation source

Request Body:

{
    "amount": {
        "amount": "7500.00",
        "currency": "ARS"
    },
    "sourceType": "flow"
}

Input Parameters:

ParameterDescriptionTypeRequired
amountNew amount of the reservationObject (Money)Yes
sourceTypeType of reservation sourceStringYes

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.

PUT /v2/clients/:client_id/credit-accounts/:product_family/reservations/:source_id/commit

Path Parameters:

ParameterDescription
client_idCustomer ID
product_familyType of financial product
source_idID 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:

CodeDescription
400Bad Request
401Unauthorized
403Forbidden
404Not Found
500Internal Server Error

Errors will include a descriptive message in the response body.