Skip to main content

Usage

Available on the Para client in @getpara/web-sdk, @getpara/react-sdk, @getpara/react-sdk-lite, @getpara/server-sdk and @getpara/react-native-wallet, through @getpara/core-sdk.
Signature
Only a pending case can be cancelled. The case ends with status cancelled and terminalReason case_cancelled. When a pending transaction from a user’s wallet is waiting on the case, Para discards it, so that request never signs. A request that should still go ahead needs a new attempt, which opens a new case. When signing returned a pendingTransactionId, find its case with listInitiatedApprovalCases: it is the case whose request.id matches that ID.

Access and Portal behavior

Signed-in user who started the request, or the linked user named as initiatorUserId on a request for a wallet your app owns. Approvers cannot cancel a case. Your backend can cancel any of your app’s pending cases with the REST SDK cancelPartnerApprovalCase method. Does not open Portal. The linked user cannot list the case, so pass them the approvalCaseId from the POLICY_REVIEW_REQUIRED error: the REST response body, or error.data in the server and React Native SDKs. The web and React SDKs currently reject with a generic error that has no data.

Errors

A failed request rejects with an error that carries status, code and message. A few refusals have their own code, such as POLICY_DENIED, INITIATOR_CANNOT_REVIEW and APPROVAL_CASES_AFFECTED. Most arrive as plain text, with code set to ERR_BAD_REQUEST for a 4xx status and the server message in message, so branch on message for those. Rows marked Client throw a plain Error with only a message, before any request is sent, so call the method inside try with await to catch every error. Permissions errors lists every error.