# Update transaction banking account Update a transaction banking account. **NOTE**: This endpoint requires an account token - an access token encoded with an external account ID. Tokens can expire quickly, which can result in a `401 Unauthorized` message. This endpoint generates the following events: - [Corporate account updated](https://developers.pismo.io/events/docs/corporate-corporate-account-change-1) - [Account status changed](https://developers.pismo.io/events/docs/account-status-change-2) # OpenAPI definition ```json { "openapi": "3.0.0", "info": { "title": "Banking - Transaction banking", "version": "0.9.0", "description": "Transaction banking API", "contact": { "name": "API Support", "url": "https://developers.pismo.io/support/" }, "license": { "name": "Copyright Pismo" } }, "servers": [ { "url": "https://sandbox.pismolabs.io", "description": "Sandbox API server for testing" } ], "security": [ { "BearerAuth": [] } ], "tags": [ { "name": "Accounts", "description": "Accounts endpoints" } ], "components": { "parameters": { "ExternalAccountIdPath": { "name": "externalAccountId", "in": "path", "description": "External account ID", "schema": { "type": "string", "minLength": 1, "maxLength": 60 }, "example": "12345678901", "required": true } }, "schemas": { "CustomFields": { "type": "object", "description": "Name-value fields for any account-related data your organization needs to store at Pismo. This field can have its values validated against the JSON schema stored at the division (referenced by the `division_code`) field `schema`." }, "DivisionCode": { "type": "string", "maxLength": 36, "description": "Code used to identify your division within the organization. Division code should only contain letters, numbers, and hyphens.", "example": "US" }, "ErrorCode": { "description": "Error code\n`minLength: 1`\n`maxLength: 12`\n", "type": "string", "minLength": 1, "maxLength": 12, "example": "WPMT0017" }, "ErrorMessage": { "description": "Error message\n`minLength: 1`\n`maxLength: 1000`\n", "type": "string", "minLength": 1, "maxLength": 1000, "example": "Invalid JSON payload received: Error unmarshalling request" }, "ErrorResponse": { "type": "object", "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "message": { "$ref": "#/components/schemas/ErrorMessage" } } }, "PatchAccountRequest": { "type": "object", "description": "Update corporate account request object", "properties": { "division_code": { "$ref": "#/components/schemas/DivisionCode" }, "program_id": { "$ref": "#/components/schemas/ProgramID" }, "applicant": { "type": "object", "properties": { "custom_fields": { "$ref": "#/components/schemas/CustomFields" } } } } }, "ProgramID": { "type": "integer", "format": "int64", "maximum": 99999999999, "description": "Program ID. The program must belong to the organization. Use [List programs](https://developers.pismo.io/pismo-docs/reference/programs-1) to view a list of the program IDs for the organization.\n\nThis program must be bound to the division. You can attach the program with either of the following endpoints:\n[Create division](https://developers.pismo.io/pismo-docs/reference/post-division-v2)\n[Patch division](https://developers.pismo.io/pismo-docs/reference/patch-division-v2)\n", "example": 8674 } }, "responses": { "204NoContent": { "description": "No Content" }, "401Unauthorized": { "description": "Access token is missing or invalid" }, "403Forbidden": { "description": "The request has been lost" }, "500InternalServer": { "description": "Internal Server Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" }, "examples": { "Generic internal error": { "value": { "code": "ECMN9999", "message": "Internal error" } } } } } } }, "securitySchemes": { "BearerAuth": { "type": "http", "scheme": "bearer", "bearerFormat": "JWT" } } }, "paths": { "/corporate/v1/corporate-accounts/{externalAccountId}": { "patch": { "summary": "Update transaction banking account", "description": "Update a transaction banking account.\n\n**NOTE**: This endpoint requires an account token - an access token encoded with an external account ID. Tokens can expire quickly, which can result in a `401 Unauthorized` message.\n\nThis endpoint generates the following events:\n- [Corporate account updated](https://developers.pismo.io/events/docs/corporate-corporate-account-change-1)\n- [Account status changed](https://developers.pismo.io/events/docs/account-status-change-2)\n", "operationId": "patch-account", "parameters": [ { "$ref": "#/components/parameters/ExternalAccountIdPath" } ], "tags": [ "Accounts" ], "requestBody": { "description": "Update account request body", "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PatchAccountRequest" }, "examples": { "Update account": { "value": { "division_code": "my-division", "program_id": 8674, "applicant": { "custom_fields": { "product_id": 1 } } } } } } } }, "responses": { "204": { "$ref": "#/components/responses/204NoContent" }, "400": { "description": "A Bad Request validation error.\n\nStatic Validations (mandatory field, max value, max length, etc.) have the code `WCAC0005`.\n", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" }, "examples": { "Invalid JSON payload": { "value": { "code": "WCAC0013", "message": "Invalid JSON payload received: Error unmarshalling request" } }, "Account not found:": { "value": { "code": "WCAC0012", "message": "Corporate account not found" } }, "Program ID not bound to division": { "value": { "code": "WCAC0006", "message": "Program not bound to Division" } }, "custom_fields don't match with the Division JSON schema": { "value": { "code": "WCAC0004", "message": "schema validation error: [validation description]" } }, "division_code max length": { "value": { "code": "WCAC0005", "message": "division_code must be a maximum of 36 characters in length" } }, "program_id max size": { "value": { "code": "WCAC0005", "message": "program_id must be 99,999,999,999 or less" } }, "Programs with different currencies": { "value": { "code": "WCAC0031", "message": "This program migration is not permitted. The programs currency must be the same type" } }, "Programs with different types": { "value": { "code": "WCAC0032", "message": "This program migration is not permitted. The programs must be the same type" } }, "No attributes to update": { "value": { "code": "WCAC0033", "message": "There are no attributes to update." } } } } } }, "401": { "$ref": "#/components/responses/401Unauthorized" }, "403": { "$ref": "#/components/responses/403Forbidden" }, "404": { "description": "Not Found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" }, "examples": { "Division not found": { "value": { "code": "WDIV0002", "message": "Division not found" } } } } } }, "500": { "$ref": "#/components/responses/500InternalServer" } } } } } } ```