Skip to main content

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

Return Value

result
UpdateIntentResult

Example

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?

FieldUpdatable?
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

CodeCauseResolution
PASSKEY_REJECTEDUser declined the passkey promptAllow retry
PASSKEY_UNAVAILABLEDevice doesn’t support WebAuthnInform user
INTENT_EXPIREDIntent already expiredRegister a new intent
MANDATE_VIOLATIONInvalid update (e.g., past expiry)Check params

Next Steps