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.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)
}
});
| Property | Type | Required | Description |
|---|---|---|---|
authUrl | string | Yes | Authorization URL returned by the wallet to start the signing experience. |
extParams | Record<string, unknown> | No | Optional additional parameters, for example subClientId. |
callback | Function | No | Single callback invoked with the signing result (success or failure). Provides the payloads in Callback payloads. |
AlipayJSBridge.call delivers a single response object to your callback. Inspect the returned fields to determine success or failure.
| Property | Type | Description |
|---|---|---|
authCode | string | Authorization code used to obtain an agreement token. Maximum length 32 characters. |
{
"authCode": "663A8FA9D83648EE8AA11FF682989DC7"
}
| Property | Type | Description |
|---|---|---|
errorCode | string | Error code describing why the signing failed. |
errorMessage / errMessage | string | Human-readable message for the failure (property may vary by runtime version). |
| Code | Description |
|---|---|
6001 | User cancelled the signing process. |
6002 | Network exception prevented signing. |
6003 | Signing failed due to service error. |