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.
Attributes
| Attribute | Description | Type |
|---|---|---|
calendarId | Unique identifier of the calendar | String (UUID) |
name | Name of the calendar | String |
description | Detailed description of the calendar | String |
type | Type of calendar | String |
exclusionDays | Days of the week excluded as business days | Array of String |
holidays | Specific holidays | Array of Object |
year | Year the calendar applies to | Integer |
createdAt | Calendar creation date | String (DateTime) |
updatedAt | Date of the last calendar update | String (DateTime) |
Detail of nested objects
holidays Object
| Attribute | Description | Type |
|---|---|---|
day | Day of the month (1-31) | Integer |
month | Month of the year | String |
type Values
| Type | Value | Description |
|---|---|---|
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.
Path Parameters:
| Parameter | Description |
|---|---|
partnerId | ID of the partner to obtain its calendars |
Query Parameters:
| Parameter | Description | Type |
|---|---|---|
type | Filter by calendar type | String |
year | Filter by calendar year | Integer |
page | Page number (default: 1) | Integer |
per-page | Items per page (default: 10) | Integer |
sort-by | Field to sort by | String |
sort-direction | Sorting direction (asc or desc) | String |
Successful Response (200)
Returns an array of Calendar objects
Specific Errors
| Response Code | Description |
|---|---|
| 400 | Invalid request. This can occur if required parameters are missing or if the provided values are not valid. |
| 403 | Not allowed. The user does not have access to the partner's calendars. |
| 404 | The specified partner does not exist. |
Retrieve a Specific Calendar
Retrieves detailed information of a specific calendar for a partner.
Path Parameters:
| Parameter | Description |
|---|---|
partnerId | ID of the partner |
calendarId | ID of the calendar to retrieve |
Successful Response (200)
Returns a Calendar object
Specific Errors
| Response Code | Description |
|---|---|
| 400 | Invalid request. This can occur if required parameters are missing or if the provided values are not valid. |
| 403 | Not allowed. The user does not have access to the requested calendar. |
| 404 | The specified calendar or partner does not exist. |
Create a New Calendar
Creates a new custom (Custom) calendar for a specific partner.
Path Parameters:
| Parameter | Description |
|---|---|
partnerId | ID of the partner for which the calendar is created |
Input Parameters
| Parameter | Description | Type | Required |
|---|---|---|---|
name | Name of the calendar | String | Yes |
description | Detailed description of the calendar | String | No |
exclusionDays | Days of the week excluded as business days | Array of String | No |
holidays | List of dates representing holidays | Array of String | No |
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
Successful Response (201)
The response includes a created Calendar object.
Specific Errors
| Response Code | Description |
|---|---|
| 400 | Invalid request. This can occur if required parameters are missing or if the provided values are not valid. |
| 403 | Not allowed. The user does not have permissions to create calendars for this partner. |
| 404 | The specified partner does not exist. |
| 409 | Conflict. A calendar with the same name already exists for this partner and year. |
Delete a Calendar
Deletes a specific calendar for a partner.
Path Parameters:
| Parameter | Description |
|---|---|
partnerId | ID of the partner |
calendarId | ID of the calendar to delete |
Successful Response (204)
Successful request (NoContent)
Specific Errors
| Response Code | Description |
|---|---|
| 400 | Invalid request. This can occur if required parameters are missing or if the provided values are not valid. |
| 403 | Not allowed. The user does not have permissions to delete this calendar. |
| 404 | The specified calendar or partner does not exist. |
| 409 | Conflict. The calendar cannot be deleted because it is being used in active operations. |
Error Handling
The API can return the following error codes:
| Code | Description |
|---|---|
| 400 | Bad Request |
| 401 | Unauthorized |
| 403 | Forbidden |
| 404 | Not Found |
| 409 | Conflict |
| 500 | Internal Server Error |
Errors will include a descriptive message in the response body to help identify and resolve the issue.