AltScore
Credit Management System (CMS)

DPA Calendars API

This API allows managing the calendars used in Deferred Payment Agreement (DPA) workflows. It provides endpoints to create, retrieve, list, and delete calendars for a specific partner.

Calendars are used to determine business days and correctly calculate installment due dates in DPA workflows, respecting holidays and specific exclusions by country or partner.

The CMS Base URL is used (see introduction).

The Calendar Object

The Calendar object represents a calendar that defines business and non-business days for date calculations in DPA workflows.

{
  "calendarId": "0b51843a-09e1-4614-aa8d-fec3ff9693f5",
  "name": "Mexico Calendar 2025",
  "description": "Calendar for operations in Mexico during 2025",
  "type": "Custom",
  "exclusionDays": [
    "Saturday",
    "Sunday"
  ],
  "holidays": [
    {
      "day": 1,
      "month": "January"
    },
    {
      "day": 5,
      "month": "February"
    }
  ],
  "year": 2025,
  "createdAt": "2024-11-15T14:30:22.123456Z",
  "updatedAt": "2024-11-15T14:30:22.123456Z"
}

Attributes

AttributeDescriptionType
calendarIdUnique identifier of the calendarString (UUID)
nameName of the calendarString
descriptionDetailed description of the calendarString
typeType of calendarString
exclusionDaysDays of the week excluded as business daysArray of String
holidaysSpecific holidaysArray of Object
yearYear the calendar applies toInteger
createdAtCalendar creation dateString (DateTime)
updatedAtDate of the last calendar updateString (DateTime)

Detail of nested objects

holidays Object

AttributeDescriptionType
dayDay of the month (1-31)Integer
monthMonth of the yearString

type Values

TypeValueDescription
BusinessDays"BusinessDays"Predefined calendar that considers business days excluding weekends (Saturdays and Sundays)
NaturalDays"NaturalDays"Considers all calendar days as business days
Custom"Custom"Custom configuration of business days with exclusions and holidays defined by the user

Available Operations

List Partner Calendars

Retrieves the list of available calendars for a specific partner.

GET /v2/partners/:partnerId/calendars/dpa

Path Parameters:

ParameterDescription
partnerIdID of the partner to obtain its calendars

Query Parameters:

ParameterDescriptionType
typeFilter by calendar typeString
yearFilter by calendar yearInteger
pagePage number (default: 1)Integer
per-pageItems per page (default: 10)Integer
sort-byField to sort byString
sort-directionSorting direction (asc or desc)String

Successful Response (200)

Returns an array of Calendar objects

Specific Errors

Response CodeDescription
400Invalid request. This can occur if required parameters are missing or if the provided values are not valid.
403Not allowed. The user does not have access to the partner's calendars.
404The specified partner does not exist.

Retrieve a Specific Calendar

Retrieves detailed information of a specific calendar for a partner.

GET /v2/partners/:partnerId/calendars/dpa/:calendarId

Path Parameters:

ParameterDescription
partnerIdID of the partner
calendarIdID of the calendar to retrieve

Successful Response (200)

Returns a Calendar object

Specific Errors

Response CodeDescription
400Invalid request. This can occur if required parameters are missing or if the provided values are not valid.
403Not allowed. The user does not have access to the requested calendar.
404The specified calendar or partner does not exist.

Create a New Calendar

Creates a new custom (Custom) calendar for a specific partner.

POST /v2/partners/:partnerId/calendars/dpa

Path Parameters:

ParameterDescription
partnerIdID of the partner for which the calendar is created

Input Parameters

ParameterDescriptionTypeRequired
nameName of the calendarStringYes
descriptionDetailed description of the calendarStringNo
exclusionDaysDays of the week excluded as business daysArray of StringNo
holidaysList of dates representing holidaysArray of StringNo

Notes:

  • Only "Custom" type calendars can be created. "BusinessDays" and "NaturalDays" calendars are predefined by the system.
  • Exclusion days must be names of the days of the week in English: "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday".
  • Holidays must be in the format "YYYY-MM-DD", for example: "2025-01-01".
  • For a Custom calendar, exclusion days and/or holidays must be specified according to the partner's needs.

Request Body

{
  "name": "Mexico Calendar 2025",
  "description": "Calendar for operations in Mexico during 2025",
  "exclusionDays": [
    "Saturday",
    "Sunday"
  ],
  "holidays": [
    "2025-01-01",
    "2025-02-05"
  ]
}

Successful Response (201)

The response includes a created Calendar object.

Specific Errors

Response CodeDescription
400Invalid request. This can occur if required parameters are missing or if the provided values are not valid.
403Not allowed. The user does not have permissions to create calendars for this partner.
404The specified partner does not exist.
409Conflict. A calendar with the same name already exists for this partner and year.

Delete a Calendar

Deletes a specific calendar for a partner.

DELETE /v2/partners/:partnerId/calendars/dpa/:calendarId

Path Parameters:

ParameterDescription
partnerIdID of the partner
calendarIdID of the calendar to delete

Successful Response (204)

Successful request (NoContent)

Specific Errors

Response CodeDescription
400Invalid request. This can occur if required parameters are missing or if the provided values are not valid.
403Not allowed. The user does not have permissions to delete this calendar.
404The specified calendar or partner does not exist.
409Conflict. The calendar cannot be deleted because it is being used in active operations.

Error Handling

The API can return the following error codes:

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

Errors will include a descriptive message in the response body to help identify and resolve the issue.