Overview
The updateIntent() method modifies an existing intent’s values. Requires passkey authentication. The mandate is updated with the card network directly.
Updating an intent invalidates any previously generated payment tokens. You must invoke the intent again after updating.
Method Signature
prava . updateIntent ( params : UpdateIntentParams ): Promise < UpdateIntentResult >
Parameters
params
UpdateIntentParams
required
New frequency (one-time · daily · weekly · monthly)
Return Value
List of fields that were changed (e.g., ["amount", "useLimit"])
Example
Update Amount
Extend Expiry
import { PravaSDK } from '@prava-sdk/core' ;
const prava = new PravaSDK ({ publishableKey: 'pk_live_xxx' });
const updated = await prava . updateIntent ({
intentId: 'int_m7kx9...' ,
amount: 35.00 , // was 25.00
useLimit: 10 , // was 5
});
// Passkey prompt fires → mandate updated with card network
console . log ( updated . status ); // "updated"
console . log ( updated . updatedFields ); // ["amount", "useLimit"]
What Can Be Updated?
Field Updatable? amount✅ Yes itemCount✅ Yes useLimit✅ Yes frequency✅ Yes expiresAt✅ Yes cardId❌ No — delete and create new merchant❌ No — security restriction
Partial updates are supported — only provide the fields you want to change.
Error Handling
Code Cause Resolution PASSKEY_REJECTEDUser declined the passkey prompt Allow retry PASSKEY_UNAVAILABLEDevice doesn’t support WebAuthn Inform user INTENT_EXPIREDIntent already expired Register a new intent MANDATE_VIOLATIONInvalid update (e.g., past expiry) Check params
Next Steps