E-transfer
Cancel Active Session
POST
Immediately terminate an active e-Transfer session to prevent further user access or resumption.
To successfully call this endpoint, you must have a valid access token from the /Authorize endpoint.
Cancel Active Session
Use this endpoint to immediately close an active session so the user can no longer access or resume the e-Transfer flow. This is useful when a user abandons the flow in your application and you want to ensure the session cannot be reused.When to Use This Endpoint
- User abandons the payment flow in your application
- Need to prevent session reuse for security reasons
- Want to clean up active sessions before their natural timeout
- Implementing session cleanup workflows
Session Termination Behavior
When you call this endpoint with a valid sessionId:- Immediate termination: The session is terminated immediately
- Frontend handling: The hosted front-end will behave as if the session has timed out and display an appropriate error state
- Status change: Session status changes to
Cancelled
Implementation Notes
Recommended but not required:- If you do not call this endpoint, sessions will automatically expire based on the timeout window defined during onboarding
- If you want to end a session before that timeout, you must call this endpoint
Response Fields
- sessionId — unique session identifier for the terminated session
- referenceId — your internal reference ID (if provided during session creation)
- status — session status (always
Cancelledfor successful cancellation) - statusDetails — additional status context indicating the session was cancelled by API request
Best Practices
Session Cleanup
- Call this endpoint when users navigate away from the payment flow
- Implement cleanup for abandoned sessions in your application
- Consider batch cleanup for old active sessions
Error Handling
- Handle cases where the session is already terminated
- Implement retry logic for transient network failures
- Log cancellation events for audit purposes
Related Endpoints
- Initiate Session — create an e-Transfer session
- Session Details — retrieve full session information
- /Authorize — obtain an access token