Skip to main content
POST
/
api
/
v2
/
sessions
/
{sessionId}
/
cancel
curl --location --request POST '{{BaseUri}}/api/v2/sessions/{{sessionId}}/cancel' \
--header 'Authorization: Bearer {{access_token}}'
{
  "sessionId": "aadd08f2-83ce-456d-84ed-c68cfed4ee7b",
  "referenceId": "USER12345",
  "status": "Cancelled"
}

Documentation Index

Fetch the complete documentation index at: https://docs.flinks.com/llms.txt

Use this file to discover all available pages before exploring further.

This endpoint is not yet released. It will be available soon.
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
curl --location --request POST '{{BaseUri}}/api/v2/sessions/{{sessionId}}/cancel' \
--header 'Authorization: Bearer {{access_token}}'
{
  "sessionId": "aadd08f2-83ce-456d-84ed-c68cfed4ee7b",
  "referenceId": "USER12345",
  "status": "Cancelled"
}

Response Fields

  • sessionId — unique session identifier for the terminated session
  • referenceId — your internal reference ID (if provided during session creation)
  • status — session status (always Cancelled for 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

Headers

x-client-id
string

Path Parameters

sessionId
string<uuid>
required

Response

Success

sessionId
string<uuid>
referenceId
string | null
status
enum<string>
Available options:
Initiated,
Failed,
Cancelled,
Expired,
Completed
statusDetails
string | null