# Cancel scheduled payment Cancel a scheduled payment by its ID. For more information on payments operations, refer to the [Corporate Banking Launch Reference](doc:corporate-banking-launch-reference) guide. This endpoint generates a [Current scheduled payment status displayed](https://developers.pismo.io/events/docs/corporate-schedule-payment-1) event. See the [Data and reporting](doc:data-reporting-overview) guide for more information on events and setting up event notifications. **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. # 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": "Payments", "description": "Payment endpoints supporting external accounts" } ], "components": { "parameters": { "ScheduledPaymentIdPath": { "name": "scheduledPaymentId", "in": "path", "description": "Scheduled payment ID", "schema": { "type": "string" }, "required": true, "example": "1234" } }, "schemas": { "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" } } } }, "responses": { "204NoContent": { "description": "No Content" }, "403Forbidden": { "description": "The request has been lost" } }, "securitySchemes": { "BearerAuth": { "type": "http", "scheme": "bearer", "bearerFormat": "JWT" } } }, "paths": { "/corporate/v2/scheduled-payments/{scheduledPaymentId}": { "delete": { "summary": "Cancel scheduled payment", "operationId": "corporate-v2-delete-scheduled-payment", "description": "Cancel a scheduled payment by its ID. For more information on payments operations, refer to the [Corporate Banking Launch Reference](https://developers.pismo.io/pismo-docs/docs/corporate-banking-launch-reference) guide.\n\nThis endpoint generates a [Current scheduled payment status displayed](https://developers.pismo.io/events/docs/corporate-schedule-payment-1) event.\nSee the [Data and reporting](https://developers.pismo.io/pismo-docs/docs/data-reporting-overview) guide for more information on events and setting up event notifications.\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.", "parameters": [ { "$ref": "#/components/parameters/ScheduledPaymentIdPath" } ], "tags": [ "Payments" ], "responses": { "204": { "$ref": "#/components/responses/204NoContent" }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" }, "examples": { "Unrecognized account ID type": { "value": { "code": "WCAC0010", "message": "Token contains an unrecognized account ID type" } }, "Scheduled payment not found": { "value": { "code": "WPMT0012", "message": "Scheduled payment not found" } }, "Scheduled payment not active": { "value": { "code": "WPMT0013", "message": "Scheduled payment not active" } } } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" }, "examples": { "Unauthorized account": { "value": { "code": "WCAC0001", "message": "Account not authorized" } } } } } }, "403": { "$ref": "#/components/responses/403Forbidden" }, "500": { "description": "Internal Errors", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" }, "examples": { "Generic internal error": { "value": { "code": "ECMN9999", "message": "Internal error" } } } } } } } } } } } ```