# Configure timing for accrual calculation
Set up the time when the daily accrual calculations should occur.
If you provide a value for `division_id`, then the value provided in `time_utc` is only used for the corresponding division. That is, it's only used for the accruals of installment plans associated with that division.
If you don't provide a value for `division_id`, then the value provided in `time_utc` is used for all installment plans in the program's org, unless they are associated with a division that already has a time assigned to it. (That is, unless you already ran the endpoint with `division_id` set to the ID for that division.)
Note: If you run the endpoint a second time using the same value `division_id`, it generates an error. This also happens if you run the endpoint twice without providing a value for `division_id`.
# OpenAPI definition
```json
{
"openapi": "3.1.0",
"info": {
"title": "Banking - Interest engine",
"version": "1.0.0",
"description": "API to handle interest-bearing account operations",
"termsOfService": "https://developers.pismo.io/terms/",
"contact": {
"name": "API Support",
"url": "https://developers.pismolabs.io/pismo-docs/docs/support"
},
"license": {
"name": "Copyright Pismo"
}
},
"servers": [
{
"url": "https://sandbox.pismolabs.io/interest-engine",
"description": "Sandbox API server for testing"
},
{
"url": "https://sandbox.pismolabs.io/passport/v2/s2s/access-token",
"description": "Sandbox API for oauth2"
}
],
"tags": [
{
"name": "Interest accrual",
"description": "Interest accrual"
}
],
"components": {
"parameters": {
"Authorization": {
"name": "authorization",
"in": "header",
"description": "Authorization",
"required": true,
"example": "Bearer YOUR_BEARER_TOKEN",
"schema": {
"type": "string"
}
},
"XProgramId": {
"name": "x-program-id",
"in": "header",
"description": "Program ID",
"required": true,
"example": "1233",
"schema": {
"type": "string"
}
}
},
"schemas": {
"DivisionId": {
"type": "string",
"description": "Division ID attached to the interest plan for accrual by division",
"example": "d9b2c9e1-4633-4a10-841b-270f7f1493cd"
},
"InterestAccrualSetupResponse": {
"title": "Accrual setup response",
"type": "object",
"properties": {
"time_utc": {
"$ref": "#/components/schemas/TimeUTC"
},
"division_id": {
"$ref": "#/components/schemas/DivisionId"
}
},
"required": [
"time_utc"
],
"example": {
"division_id": "d9b2c9e1-4633-4a10-841b-270f7f1493cd",
"time_utc": "07:15"
}
},
"InterestAccrualSetupRequest": {
"title": "Accrual setup request",
"type": "object",
"required": [
"time_utc"
],
"properties": {
"time_utc": {
"$ref": "#/components/schemas/TimeUTC"
},
"division_id": {
"$ref": "#/components/schemas/DivisionId"
}
},
"example": {
"division_id": "d9b2c9e1-4633-4a10-841b-270f7f1493cd",
"time_utc": "07:15"
}
},
"TimeUTC": {
"type": "string",
"description": "Time when accrual calculation is performed, specified in hours and minutes. `07:15` and `19:15` are the only values accepted.",
"enum": [
"07:15",
"19:15"
],
"example": "19:15"
}
},
"securitySchemes": {
"BearerAuth": {
"type": "http",
"scheme": "bearer",
"bearerFormat": "JWT"
}
},
"responses": {
"400BadRequest": {
"description": "Bad request"
},
"401Unauthorized": {
"description": "Unauthorized"
},
"404NotFound": {
"description": "Not found"
},
"500InternalServerError": {
"description": "Internal server error"
}
}
},
"security": [
{
"BearerAuth": []
}
],
"paths": {
"/v1/interest/accrual/setup": {
"post": {
"summary": "Configure timing for accrual calculation",
"description": "Set up the time when the daily accrual calculations should occur.\n\nIf you provide a value for `division_id`, then the value provided in `time_utc` is only used for the corresponding division. That is, it's only used for the accruals of installment plans associated with that division. \n\nIf you don't provide a value for `division_id`, then the value provided in `time_utc` is used for all installment plans in the program's org, unless they are associated with a division that already has a time assigned to it. (That is, unless you already ran the endpoint with `division_id` set to the ID for that division.)\n\nNote: If you run the endpoint a second time using the same value `division_id`, it generates an error. This also happens if you run the endpoint twice without providing a value for `division_id`.\n",
"tags": [
"Interest accrual"
],
"operationId": "post-v1-interest-accrual-setup",
"parameters": [
{
"$ref": "#/components/parameters/XProgramId"
},
{
"$ref": "#/components/parameters/Authorization"
}
],
"requestBody": {
"description": "Request body",
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/InterestAccrualSetupRequest"
}
}
}
},
"responses": {
"200": {
"description": "OK",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/InterestAccrualSetupResponse"
}
}
}
},
"400": {
"$ref": "#/components/responses/400BadRequest"
},
"401": {
"$ref": "#/components/responses/401Unauthorized"
},
"404": {
"$ref": "#/components/responses/404NotFound"
},
"500": {
"$ref": "#/components/responses/500InternalServerError"
}
}
}
}
}
}
```