Essential APIs

qicardSignContract

Direct users to authorize and sign a QiCard agreement for recurring payments.

Overview

The qicardSignContract JSAPI redirects the user to the QiCard authorization page. Invoke it with AlipayJSBridge.call to launch the hosted signing screen. After the user confirms the agreement, the Mini Program receives an authCode that your backend exchanges for an agreement token via applyToken. Ensure the host app runtime is version 1.24.6 or higher.

AlipayJSBridge.call('qicardSignContract') participates in the Agreement Payment flow to capture long-term user consent.
To view the end-to-end diagram, see the Agreement Payment flow.

Usage Example

AlipayJSBridge.call('qicardSignContract', {
  authUrl: 'https://wallet.example.com/sign?contract=xxxxxxx', // the auth URL returned by the wallet
  extParams: {}
}, (res) => {
  if (!res.error && !res.errorCode && res.authCode) {
    // handle successful authorization (store authCode, advance UI)
  } else {
    // Handle error response (logging, user feedback)
  }
});

Parameters

PropertyTypeRequiredDescription
authUrlstringYesAuthorization URL returned by the wallet to start the signing experience.
extParamsRecord<string, unknown>NoOptional additional parameters, for example subClientId.
callbackFunctionNoSingle callback invoked with the signing result (success or failure). Provides the payloads in Callback payloads.

Callback Payloads

AlipayJSBridge.call delivers a single response object to your callback. Inspect the returned fields to determine success or failure.

Success

PropertyTypeDescription
authCodestringAuthorization code used to obtain an agreement token. Maximum length 32 characters.
{
  "authCode": "663A8FA9D83648EE8AA11FF682989DC7"
}

Failure

PropertyTypeDescription
errorCodestringError code describing why the signing failed.
errorMessage / errMessagestringHuman-readable message for the failure (property may vary by runtime version).

Error Codes

CodeDescription
6001User cancelled the signing process.
6002Network exception prevented signing.
6003Signing failed due to service error.