# Get program attachment
Gets a program's attached product.
# OpenAPI definition
```json
{
"openapi": "3.0.0",
"info": {
"title": "Banking - Interest-bearing accounts",
"version": "1.0.0",
"description": "API for interest-bearing account functionality",
"contact": {
"name": "API Support",
"url": "https://developers.pismo.io/support/"
},
"license": {
"name": "Copyright Pismo"
}
},
"servers": [
{
"url": "https://sandbox.pismolabs.io/savings-products",
"description": "Sandbox API server for testing"
}
],
"tags": [
{
"name": "Program attachment",
"description": "Endpoints that manage program attachments to interest-bearing account products"
}
],
"components": {
"parameters": {
"authorizationTokenHeader": {
"name": "AuthorizationToken",
"in": "header",
"schema": {
"type": "string"
},
"required": true,
"description": "Account token. Token encoded with a Pismo account ID. Tokens can expire quickly, which can result in a 401 Unauthorized error.\n",
"example": 1234
},
"programIdPath": {
"description": "Program ID",
"in": "path",
"name": "programId",
"required": true,
"schema": {
"type": "integer"
},
"example": 123
}
},
"schemas": {
"ErrorResponse": {
"type": "object",
"properties": {
"code": {
"type": "string",
"description": "Error type code",
"example": "EIBACC0003"
},
"details": {
"type": "string",
"description": "Error details",
"example": "error EIBACC0008: Validation error [(Field 'Order' is invalid)]"
},
"message": {
"description": "Error message",
"example": "Bad Request",
"type": "string"
}
}
},
"PayoutAccount": {
"properties": {
"label": {
"type": "string",
"description": "Label to identify the account\n",
"example": "My payout account"
},
"type": {
"type": "string",
"description": "Payout account type, either `INTERNAL` or `EXTERNAL`\n",
"enum": [
"INTERNAL",
"EXTERNAL"
],
"example": "INTERNAL"
},
"internal_account_id": {
"type": "number",
"description": "Internal account ID for the account that receives the payments.\nRequired for type `INTERNAL` and not allowed for `EXTERNAL`.\n",
"example": 123456
},
"external_account": {
"type": "object",
"description": "Contains user-defined key-value pairs that identify the external account receiving the payments.\nNote that external account information is client-provided.\n\n Required for type `EXTERNAL` and not allowed for `INTERNAL`\n",
"example": {
"key": "value"
}
}
},
"type": "object"
},
"MaturityPeriod": {
"type": "object",
"description": "Defines the maturity period by specifying a unit and a value
\n\n**How unit works**\n\n- `DAYS`: uses the value directly as the number of days. For example, `unit` = `DAYS`, `value` = `90` → 90 days.\n- `WEEKS`: multiplies the value by 7. For example, `unit`= `WEEKS`, `value` = `4` → 28 days.\n- `MONTHS`: applies calendar‑month arithmetic with end‑of‑month clamping.\n- `YEARS`: applies calendar‑year arithmetic. For example, specifying `unit` = `YEARS`, `value` = `1` means one calendar year from 2024‑01‑31 → 2025‑01‑31.\n\n**End-of-Month (EOM) clamping for** `MONTHS`
\n\nClamps the date to the last valid day of the month when the target day does not exist.
\nExamples:\n- `2024-01-31` + 1 month → `2024-02-29` (2024 is a leap year)\n- `2024-01-31` + 1 month → `2025-02-28` (2025 is not a leap year)\n- `2024-03-31` + 1 month → `2024-04-30` (April has 30 days)\n- `2024-01-15` + 6 months → `2024-07-15` (no clamping needed)\n\n**Leap year behavior for** `YEARS`:
\n- `2024-02-29` + 1 year → `2025-02-28` (2025 has no Feb 29)\n\n**Back-calculation:**
\nFor `WEEKS`, `MONTHS`, and `YEARS`, converts the resulting calendar date back into a day count for minimum or maximum term validation against the product’s configured limits.\n\n**Default:**
\nIf omitted, the product's configured default maturity term `PRODUCT_DEFAULT_MATURITY_DATE_DAYS` is used.\n",
"required": [
"unit",
"value"
],
"properties": {
"unit": {
"type": "string",
"description": "The time unit for the maturity period",
"enum": [
"DAYS",
"WEEKS",
"MONTHS",
"YEARS"
],
"example": "MONTHS"
},
"value": {
"type": "integer",
"description": "The number of time units until maturity. Must be greater than 0",
"minimum": 1,
"example": 6
}
}
},
"ProgramAttachment": {
"type": "object",
"properties": {
"product_type": {
"type": "string",
"description": "Product type.",
"enum": [
"deposit",
"savings-account"
]
},
"product_id": {
"type": "string",
"description": "Product identifier.",
"example": "2c336e9d-d04f-4fd0-8f6e-25808f48d70c"
},
"interest_plan_id": {
"type": "string",
"description": "Interest rate plan ID. This corresponds to the ID you created using the [Create interest plan version](https://developers.pismo.io/pismo-docs/reference/patch-v1-interest-plan)) endpoint.",
"example": "263d509a-d5d0-4b3a-b909-ce1b9174beff"
},
"maturity_period": {
"$ref": "#/components/schemas/MaturityPeriod"
},
"maturity_date": {
"type": "string",
"format": "date",
"description": "The calculated maturity date in `YYYY-MM-DD` format.
\nThis date is computed from the maturity period provided in the request.\n",
"example": "2026-10-07"
},
"attachment_date": {
"type": "string",
"format": "date-time",
"description": "Date and time on which the product was attached to the program.",
"example": "2024-01-23T13:26:25.000Z"
},
"fee_model_id": {
"type": "string",
"description": "Fee model identifier, if applicable.",
"example": "fee-model-123"
},
"payout_account": {
"$ref": "#/components/schemas/PayoutAccount"
}
}
}
},
"securitySchemes": {
"BearerAuth": {
"type": "http",
"scheme": "bearer",
"bearerFormat": "JWT"
}
},
"responses": {
"400BadRequest": {
"description": "Bad request",
"content": {
"application/json": {
"schema": {
"oneOf": [
{
"$ref": "#/components/schemas/ErrorResponse"
}
]
},
"examples": {
"invalidRequestBody": {
"summary": "Bad Request",
"value": {
"code": "EIBACC0008",
"message": "Bad Request",
"detail": "error EIBACC0008: Validation error [(Field 'Order' is invalid)]"
}
}
}
}
}
},
"404NotFound": {
"description": "Bad request",
"content": {
"application/json": {
"schema": {
"oneOf": [
{
"$ref": "#/components/schemas/ErrorResponse"
}
]
},
"examples": {
"invalidRequestBody": {
"summary": "Bad Request",
"value": {
"code": "EIBACC0064",
"message": "Product not found"
}
}
}
}
}
},
"500InternalServer": {
"description": "Internal error",
"content": {
"application/json": {
"schema": {
"oneOf": [
{
"$ref": "#/components/schemas/ErrorResponse"
}
]
},
"examples": {
"internalProcessingError": {
"summary": "Internal processing error",
"value": {
"code": "EIBACC0007",
"message": "Internal error",
"detail": "Internal error"
}
}
}
}
}
}
}
},
"paths": {
"/v1/products/attachments/programs/{programId}": {
"get": {
"tags": [
"Program attachment"
],
"summary": "Get program attachment",
"description": "Gets a program's attached product.\n",
"operationId": "interest-bearing-v1-get-program-attachment",
"parameters": [
{
"$ref": "#/components/parameters/programIdPath"
},
{
"$ref": "#/components/parameters/authorizationTokenHeader"
}
],
"responses": {
"200": {
"description": "Success",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ProgramAttachment"
}
}
}
},
"400": {
"$ref": "#/components/responses/400BadRequest"
},
"404": {
"$ref": "#/components/responses/404NotFound"
},
"500": {
"$ref": "#/components/responses/500InternalServer"
}
}
}
}
},
"security": [
{
"BearerAuth": []
}
]
}
```