# Attach overdraft product to account Attach an overdraft product to a bank account.
This endpoint generates an [Overdraft account attached](https://developers.pismo.io/events/docs/overdraft-product-account-attach-1) event. # OpenAPI definition ```json { "openapi": "3.0.0", "info": { "title": "Banking - Overdraft", "version": "1.0.0", "description": "This API manages overdraft functionality, allowing account holders to perform debit transactions even with an insufficient balance. Additionally, it enables the configuration of grace periods and interest rates for overdrafts.", "contact": { "name": "API Support", "url": "https://developers.pismo.io/support/" }, "license": { "name": "Copyright Pismo" } }, "servers": [ { "url": "https://sandbox.pismolabs.io/overdraft", "description": "Sandbox API server for testing" } ], "security": [ { "BearerAuth": [] } ], "tags": [ { "name": "Account", "description": "Endpoints that manage account attachments and detachment of overdraft products" } ], "components": { "parameters": { "accountIdPath": { "name": "accountId", "in": "path", "required": true, "schema": { "type": "string" }, "description": "Account ID", "example": "123456" }, "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" } }, "schemas": { "ErrorResponse": { "type": "object", "properties": { "code": { "type": "string", "description": "Error code", "example": "EOVD0001" }, "message": { "type": "string", "description": "Error message", "example": "Error" }, "details": { "type": "string", "description": "Details about the error", "example": "Error details" } } }, "ProductAttachRequest": { "type": "object", "properties": { "product_id": { "type": "string", "format": "uuid", "description": "Overdraft product ID", "example": "876b2425-9778-4f02-8c50-67683e9a205e" }, "metadata": { "type": "object", "minLength": 0, "maxLength": 1024, "additionalProperties": true, "description": "Additional details about the overdraft product. The information must be in `key:value` pair format. For example, `name:`.
\n`minLength` = `0`\n`maxLength` = `1024`\n", "example": { "key": "value" } } }, "required": [ "product_id" ] } }, "securitySchemes": { "BearerAuth": { "type": "http", "scheme": "bearer", "bearerFormat": "JWT" } }, "responses": { "400AttachProductToAccountErrorResponse": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" }, "examples": { "Validation error": { "$ref": "#/components/examples/EOVD0008" }, "Unmarshal error": { "$ref": "#/components/examples/EOVD0012" }, "Ledger API 4xx error": { "$ref": "#/components/examples/EOVD0034" }, "Balance Watcher API 4xx error": { "$ref": "#/components/examples/EOVD0040" }, "Invalid account_id path parameter": { "$ref": "#/components/examples/EOVD0043" }, "Account has attached product error": { "$ref": "#/components/examples/EOVD0050" }, "Accounts API 4xx error": { "$ref": "#/components/examples/EOVD0069" } } } } }, "403AttachProductToAccountErrorResponse": { "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" }, "examples": { "Overdraft limit not configured": { "$ref": "#/components/examples/EOVD0051" } } } } }, "404AttachProductToAccountErrorResponse": { "description": "Not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" }, "examples": { "Ledger API 404 error": { "$ref": "#/components/examples/EOVD0035" }, "Balance Watcher API 404 error": { "$ref": "#/components/examples/EOVD0041" }, "Product not found": { "$ref": "#/components/examples/EOVD0047" }, "Accounts API 404 error": { "$ref": "#/components/examples/EOVD0070" } } } } }, "409AttachProductToAccountErrorResponse": { "description": "Conflict", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" }, "examples": { "Product already attached": { "$ref": "#/components/examples/EOVD0045" } } } } }, "500AttachProductToAccountErrorResponse": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" }, "examples": { "Internal error": { "$ref": "#/components/examples/EOVD0007" }, "Send event error": { "$ref": "#/components/examples/EOVD0029" }, "Ledger API request error": { "$ref": "#/components/examples/EOVD0030" }, "Ledger API request timeout": { "$ref": "#/components/examples/EOVD0031" }, "Ledger API unmarshal response error": { "$ref": "#/components/examples/EOVD0032" }, "Ledger API unmapped response code error": { "$ref": "#/components/examples/EOVD0033" }, "Ledger API 5xx error": { "$ref": "#/components/examples/EOVD0036" }, "Balance Watcher API unmarshal response": { "$ref": "#/components/examples/EOVD0038" }, "Balance Watcher API unmapped response code error": { "$ref": "#/components/examples/EOVD0039" }, "Balance Watcher API 5xx error": { "$ref": "#/components/examples/EOVD0042" }, "Error getting product attachment": { "$ref": "#/components/examples/EOVD0044" }, "Error getting product": { "$ref": "#/components/examples/EOVD0048" }, "Error saving product attachment": { "$ref": "#/components/examples/EOVD0052" }, "Accounts API request error": { "$ref": "#/components/examples/EOVD0064" }, "Accounts API request timeout": { "$ref": "#/components/examples/EOVD0065" }, "Accounts API unmarshal response error": { "$ref": "#/components/examples/EOVD0066" }, "Accounts API unmapped response code error": { "$ref": "#/components/examples/EOVD0067" }, "Accounts API 5xx error": { "$ref": "#/components/examples/EOVD0068" } } } } } }, "examples": { "EOVD0008": { "summary": "Validation error", "value": { "code": "EOVD0008", "message": "Validation error" } }, "EOVD0012": { "summary": "Unmarshal error", "value": { "code": "EOVD0012", "message": "Unmarshal error" } }, "EOVD0034": { "summary": "Ledger API 4xx error", "value": { "code": "EOVD0034", "message": "Ledger API - Request returned error 4xx" } }, "EOVD0040": { "summary": "Balance Watcher API 4xx error", "value": { "code": "EOVD0040", "message": "Balance Watcher API - Request returned error 4xx" } }, "EOVD0043": { "summary": "Invalid account_id path parameter", "value": { "code": "EOVD0043", "message": "Invalid accountId path param" } }, "EOVD0050": { "summary": "Account has attached product error", "value": { "code": "EOVD0050", "message": "The provided account already has an attached product" } }, "EOVD0069": { "summary": "Accounts API 4xx error", "value": { "code": "EOVD0069", "message": "Accounts API - Request returned error 4xx" } }, "EOVD0051": { "summary": "Overdraft limit not configured", "value": { "code": "EOVD0051", "message": "Overdraft limit not configured" } }, "EOVD0035": { "summary": "Ledger API 404 error", "value": { "code": "EOVD0035", "message": "Ledger API - Request returned error 404" } }, "EOVD0041": { "summary": "Balance Watcher API 404 error", "value": { "code": "EOVD0041", "message": "Balance Watcher API - Request returned error 404" } }, "EOVD0047": { "summary": "Product not found", "value": { "code": "EOVD0047", "message": "Product not found" } }, "EOVD0070": { "summary": "Accounts API 404 error", "value": { "code": "EOVD0070", "message": "Accounts API - Request returned error 404" } }, "EOVD0045": { "summary": "Product already attached", "value": { "code": "EOVD0045", "message": "The provided product ID is already attached" } }, "EOVD0007": { "summary": "Internal error", "value": { "code": "EOVD0007", "message": "Internal error" } }, "EOVD0029": { "summary": "Send event error", "value": { "code": "EOVD0029", "message": "Error on sending event to topic" } }, "EOVD0030": { "summary": "Ledger API request error", "value": { "code": "EOVD0030", "message": "Ledger API request error" } }, "EOVD0031": { "summary": "Ledger API request timeout", "value": { "code": "EOVD0031", "message": "Ledger API - Request timeout" } }, "EOVD0032": { "summary": "Ledger API unmarshal response", "value": { "code": "EOVD0032", "message": "Ledger API - Failed to unmarshal response body" } }, "EOVD0033": { "summary": "Ledger API unmapped response code", "value": { "code": "EOVD0033", "message": "Ledger API - Returned an unmapped response code" } }, "EOVD0036": { "summary": "Ledger API 5xx error", "value": { "code": "EOVD0036", "message": "Ledger API - Request returned error 5xx" } }, "EOVD0038": { "summary": "Balance Watcher API unmarshal response", "value": { "code": "EOVD0038", "message": "Balance Watcher API - Failed to unmarshal response body" } }, "EOVD0039": { "summary": "Balance Watcher API unmapped response code", "value": { "code": "EOVD0039", "message": "Balance Watcher API - Returned an unmapped response code" } }, "EOVD0042": { "summary": "Balance Watcher API 5xx error", "value": { "code": "EOVD0042", "message": "Balance Watcher API - Request returned error 5xx" } }, "EOVD0044": { "summary": "Get product attachment error", "value": { "code": "EOVD0044", "message": "Failed to get product attachment" } }, "EOVD0048": { "summary": "Get product error", "value": { "code": "EOVD0048", "message": "Failed on get product" } }, "EOVD0052": { "summary": "Save product attachment error", "value": { "code": "EOVD0052", "message": "Failed to save product attachment" } }, "EOVD0064": { "summary": "Accounts API request error", "value": { "code": "EOVD0064", "message": "Accounts API - Request error" } }, "EOVD0065": { "summary": "Accounts API request timeout", "value": { "code": "EOVD0065", "message": "Accounts API - Request timeout" } }, "EOVD0066": { "summary": "Accounts API unmarshal response", "value": { "code": "EOVD0066", "message": "Accounts API - Failed to unmarshal response body" } }, "EOVD0067": { "summary": "Accounts API unmapped response code", "value": { "code": "EOVD0067", "message": "Accounts API - Returned an unmapped response code" } }, "EOVD0068": { "summary": "Accounts API 5xx error", "value": { "code": "EOVD0068", "message": "Accounts API - Request returned error 5xx" } } } }, "paths": { "/v1/overdraft/accounts/{accountId}/attach": { "post": { "tags": [ "Account" ], "summary": "Attach overdraft product to account", "description": "Attach an overdraft product to a bank account.
\nThis endpoint generates an [Overdraft account attached](https://developers.pismo.io/events/docs/overdraft-product-account-attach-1) event.\n", "operationId": "post-attach-product-to-account", "parameters": [ { "$ref": "#/components/parameters/accountIdPath" }, { "$ref": "#/components/parameters/authorizationTokenHeader" } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ProductAttachRequest" } } } }, "responses": { "204": { "description": "Product attached successfully" }, "400": { "$ref": "#/components/responses/400AttachProductToAccountErrorResponse" }, "403": { "$ref": "#/components/responses/403AttachProductToAccountErrorResponse" }, "404": { "$ref": "#/components/responses/404AttachProductToAccountErrorResponse" }, "409": { "$ref": "#/components/responses/409AttachProductToAccountErrorResponse" }, "500": { "$ref": "#/components/responses/500AttachProductToAccountErrorResponse" } } } } } } ```