AltScore
Credit Management System (CMS)

Payments API

This API allows managing payments received for customers. It provides endpoints to query and manage payments made through payment accounts.

The CMS Base URL is used (see introduction).

Table of Contents

The Payment Object

The Payment object represents a payment made by a customer and contains detailed information about the transaction.

AttributeDescriptionType
tenantIdTenant identifierString
paymentIdUnique payment identifierString (UUID)
clientIdCustomer identifierString (UUID)
partnerIdPartner identifierString (UUID)
referencePayment reference usedString
providerPayment service providerString
transactionIdTransaction identifierString (UUID)
sourceTransactionIdSource system transaction identifierString
amountPayment amount without fees or taxesObject
feesPayment feesObject
taxesPayment taxesObject
totalTotal payment amount (amount + fees + taxes)Object
createdAtRecord creation dateString (Datetime)
updateAtLast update dateString (Datetime)
transactionDateTransaction dateString (Datetime)
receivedAtPayment receipt dateString (Datetime)
processingAtPayment processing dateString (Datetime)
statusPayment status (see status table)String
remainRemaining amount not appliedObject
applicationsList of payment applications to debtsArray

The PaymentApplication Object

AttributeDescriptionType
paymentApplicationIdPayment application identifierString (UUID)
debtIdDebt identifierString (UUID)
creditSourceSystemCredit source systemString
amountAmount applied to the debtObject
applicationDateApplication dateString (Date)
createdAtApplication creation dateString (Datetime)
referenceApplication referenceString
notesNotes or comments about the applicationString
statusApplication status (see status table)String
appliedAtDate and time when it was applied (optional)String (Datetime)

Payment Operations

Get Customer Payments

Retrieves the list of payments made by a specific customer.

GET /v1/payments/{partnerId}

Path Parameters

ParameterDescriptionTypeRequired
partnerIdPartner identifierString (UUID)Yes

Query Parameters

ParameterDescriptionType
client-idComma-separated list of client IDsUUID Array
statusFilter by Payment StatusString Array
providerFilter by providerString  
sort-byField to sort byString
sort-directionSorting direction (asc or desc)String

Successful Response (200)

The response includes an array of Payment objects associated with the customer.

Specific Errors

Response CodeDescription
400Invalid request. This can occur if the provided values are not valid.
404No payments found for the specified customer.

Example of Payment Response

Below is an example of the response obtained when querying a customer's payments:

[
    {
        "tenantId": "tenant-123",
        "paymentId": "123e4567-e89b-12d3-a456-426614174000",
        "clientId": "965117da-f8cf-42b6-b8c2-3665a8029b36",
        "partnerId": "0ab1aeac-2145-4096-9435-4768c5ebb579",
        "reference": "1234567890",
        "provider": "PAYNET",
        "transactionId": "123e4567-e89b-12d3-a456-426614174111",
        "sourceTransactionId": "TX123456789",
        "amount": {
            "amount": 1000,
            "currency": "MXN"
        },
        "fees": {
            "amount": 50,
            "currency": "MXN"
        },
        "taxes": {
            "amount": 160,
            "currency": "MXN"
        },
        "total": {
            "amount": 1210,
            "currency": "MXN"
        },
        "createdAt": "2024-11-12T20:31:45.96382213Z",
        "updateAt": "2024-11-12T20:35:45.96382213Z",
        "transactionDate": "2024-11-12T20:30:45.96382213Z",
        "receivedAt": "2024-11-12T20:31:45.96382213Z",
        "processingAt": "2024-11-12T20:32:45.96382213Z",
        "status": "APPLIED",
        "remain": {
            "amount": 0,
            "currency": "MXN"
        },
        "applications": [
            {
                "paymentApplicationId": "123e4567-e89b-12d3-a456-426614174222",
                "debtId": "123e4567-e89b-12d3-a456-426614174333",
                "creditSourceSystem": "dpa",
                "amount": {
                    "amount": 1000,
                    "currency": "MXN"
                },
                "applicationDate": "2024-11-12",
                "createdAt": "2024-11-12T20:33:45.96382213Z",
                "reference": "REF-123456",
                "notes": "Monthly fee payment",
                "status": "APPLIED",
                "appliedAt": "2024-11-12T20:34:15.96382213Z"
            }
        ]
    }
]

Get a Payment

Retrieves detailed information of a specific payment.

GET /v1/payments/{partnerId}/{paymentId}

Path Parameters

ParameterDescriptionTypeRequired
partnerIdPartner identifierString (UUID)Yes
paymentIdPayment identifierString (UUID)Yes

Successful Response (200)

The response includes a Payment object.

Re-process Payments

Allows re-processing a specific payment in case a debt has not been applied, as long as the payment status is CREATED or IN_PROCESS.

PUT /v1/payments/{partnerId}/{paymentId}/retry

Path Parameters

ParameterDescriptionTypeRequired
partnerIdPartner identifierString (UUID)Yes
paymentIdPayment identifierString (UUID)Yes

Input Parameters

ParameterDescriptionTypeRequired
dateDate on which to apply the paymentString (YYYY-MM-DD)No*

Successful Response (202)

The payment has been added to the re-processing queue.

Specific Errors

Response CodeDescription
400Invalid request. This can occur if the provided values are not valid.
404Payment not found.
409Payment cannot be re-processed

Status Values

Payment Statuses

Possible values for the status field in payments:

StatusValueDescription
Created"CREATED"The payment has been created but not yet processed
Applied"APPLIED"The payment has been successfully applied
Rejected"REJECTED"The payment has been rejected
Invalid"INVALID"The payment is invalid
In Process"IN_PROCESS"The payment is being processed
Reverted"REVERTED"The payment has been reverted
Duplicated"DUPLICATED"The payment is a duplicate of an existing one
To Revert"TO_REVERT"The payment is marked to be reverted

Application Statuses

Possible values for the status field in payment applications:

StatusValueDescription
In Process"IN_PROCESS"The application is being processed
Rejected"REJECTED"The application has been rejected
Applied"APPLIED"The application has been successfully applied to the debt