VIC agent APIs and workflows
This section walks you through the available workflows for Visa Intelligent Commerce. VIC's primary goal is to establish a consumer-authorized purchase instruction, with one or more mandates, and draw tokenized payment credentials against it. Agents initiate every workflow. A successful outcome is a completed purchase using a Visa-issued credential.
User journey
This narrative walks through a typical agent-initiated purchase across every party involved (agent, Visa, issuer, and merchant) to complement the technical steps in API reference by workflow.
- The consumer provides a purchase instruction to the agent, such as product, merchant, price ceiling, quantity, and validity window.
- The agent may monitor inventory, price, or availability on the merchant site, but can only request payment credentials and complete checkout within the set instruction parameters.
- When the agent identifies that the consumer's purchase instruction parameters are met, it confirms with the consumer and begins checkout.
- The consumer authenticates the instruction, including through Visa Payment Passkey or other issuer-approved methods.
- Visa enrolls the credential into the VIC platform, stores the purchase instruction with its parameters, and validates the transaction data against the purchase instruction criteria. If validation passes, VIC returns the tokenized payment credential and one-time cryptogram to the agent.
- The agent submits the credential to the merchant checkout flow or a Payment Service Provider (PSP)-enabled flow.
- The merchant or acquirer submits authorization through existing Visa rails.
- Visa validates the token credential and confirms the authorization matches the transaction data the agent provided, performs risk and fraud checks, and sends the authorization message to the issuer.
- The issuer processes the authorization under its existing controls.
- If applicable, the agent sends post-purchase confirmation data to the Visa Intelligent Commerce platform, which Visa retains for use in the event of a dispute.
Overview of VIC Agent APIs
The API surface of Visa Intelligent Commerce centers on a single-call model: POST /vacp/v2/credentials-for-instruction handles enrollment, instruction creation, and credential retrieval in one request. Three further calls retrieve a subsequent credential, confirm transaction events, and cancel an instruction.
VIC Agent API endpoints
| Method | Path | Description |
|---|---|---|
| POST | /vacp/v2/credentials-for-instruction | Enroll consumer, create purchase instruction, retrieve first credential (primary entry point) |
| POST | /vacp/v2/instructions/{instructionId}/credentials | Retrieve a subsequent payment credential for an existing instruction |
| POST | /vacp/v2/instructions/{instructionId}/confirmation | Confirm transaction events for an instruction |
| PUT | /vacp/v2/instructions/{instructionId}/cancel | Cancel an instruction |
API reference by workflow
To retrieve a payment credential and manage its lifecycle, follow this sequence of API calls. This assumes card enrollment is already complete. Each step is broken into the journey steps it fits into, the fields it requires, and the criteria that confirm it succeeded.
See Card enrollment for the enrollment sequence.
Authenticate purchase instruction
Once a consumer has approved a purchase instruction, they must authenticate their identity through Visa Payment Passkeys or another Visa-approved method. This ensures that only trusted devices and authenticated consumers approve purchase instructions and transactions.
Launch the VTS FIDO SDK (iframe or popup) to complete passkey authentication. Confirm that the passkey was created successfully on the consumer's device (see Register Passkey).
Endpoint: POST /vts/provisionedTokens/{vProvisionedTokenID}/attestation/options
Request includes
- clientReferenceId, a unique identifier for each device
- type = AUTHENTICATE
- reasonCode = PAYMENT
- requestedVisaManagedAuthenticationForRegister = true, which launches a Visa-managed enrollment experience for device binding, issuer ID&V, and passkey creation
- tokenId, the vProvisionedTokenID
- consumerPrompt, a human-readable summary of the request
- mandates (1-10 items), with at least one mandate that includes:
- mandateId (unique)
- declineThreshold (amount, currencyCode). The currency must match the transaction currency, and all mandates for an instruction must use the same currency.
- effectiveUntilTime (epoch seconds)
- Optional: merchant/category fields, quantity, and description
- authenticationPreferencesRequested fields (selectedPopupForAuthenticate, selectedPopupForRegister), set to true for a popup or false (the default) for an iframe
Interpret response
- If action = REGISTER, no passkey is present. This indicates that either device binding, issuer ID&V, or passkey creation has failed. A retry is needed.
- If action = AUTHENTICATE, the passkey was created successfully and the issuer ID&V challenge passed.
- An AUTH_COMPLETE response indicates success. Other response events include AUTH_FAILED and AUTH_CANCELLED. In the case of AUTH_CANCELLED, the user has closed the VPP screen, and the session needs to be restarted.
Persist from AUTH_COMPLETE response
- assuranceData.identifier
- assuranceData.fidoBlob
- dfpSessionId
You need these values to provide authentication evidence in the assuranceData object of the Credentials for Instruction API request. The following table shows how the AUTH_COMPLETE response fields map to the VIC assuranceData object.
| VTS Get Device Attestation Options API Response | VIC Credentials For Instruction API Request |
|---|---|
| assuranceData.identifier | assuranceData.methodResults.identifier |
| assuranceData.fidoBlob | assuranceData.methodResults.fidoAttestationData.code / fidoAssertionData.code |
| dfpSessionId | assuranceData.methodResults.dfpSessionId |
Enroll consumer, create purchase instruction, and retrieve first credential
This is the primary transaction-time entry point: it enrolls the consumer in VIC (when necessary), creates the purchase instruction, and returns a payment credential in a single call.
Journey steps
- Card enrollment (see Card enrollment) is already complete. The agent holds a vProvisionedTokenID and device-bound Visa Payment Passkey for the consumer.
- The consumer provides a purchase instruction and fresh authentication to the agent (product, merchant, price ceiling, quantity, and validity window). Authentication is sent as assuranceData.
- The agent converts the purchase instruction into one or more structured payment mandates.
- The agent calls this endpoint, establishing the instruction and its mandate(s) inline and requesting the first usable payment credential.
- Visa enrolls the consumer in VIC, then validates the submitted transaction data against the mandate before returning a credential.
Provide the required fields
Your request must include:
- clientReferenceId: a transactional identifier you assign to this request
- client: your externalClientId (TRID) and externalAppId, plus an agent object identifying the agent (agentId, and agentSignature if you are a Trusted Agent Provider)
- consumer: the consumer's consumerId, plus countryCode, languageCode, and consumerIdentities if this is a new consumer
- tokenId: the consumer's previously provisioned vProvisionedTokenID
- assuranceData: an array of FIDO attestation/assertion verification records. Each record requires verificationEntity, verificationMethod, verificationResults, and verificationTimestamp. Set verificationMethod to 23 (FIDO2)
- appInstance: application name, device data, and IP address of the requesting client
- mandates: the consumer-authorized spend parameters (mandateId, effectiveUntilTime, declineThreshold) for this purchase
- transactionData: merchant name, merchant URL, transaction amount, the encryptedInstruction payload, and exactly one mandateReferenceData entry
- purchaseType: one of PURCHASE_HITL (Human-in-the-Loop), PURCHASE_AUTONOMOUS, or PURCHASE_RECURRING
Conditional or triggered purchases (for example, "buy when a condition is met") are only supported when purchaseType is PURCHASE_AUTONOMOUS, and require notifying the consumer and obtaining approval once the condition is met.
Example request
curl -X POST \
"https://sandbox.api.visa.com/vacp/v2/credentials-for-instruction" \
--cert your-client-cert.pem --key your-client-key.pem \
-H "Content-Type: application/json" \
-d '{
"clientReferenceId": "d48ac10b-58cc-4372-a567-0e02b2c3d489",
"client": {
"externalClientId": "e48ac10b-58cc-4372-a567-0e02b2c3d489",
"externalAppId": "e48ac10b-58cc-4372-a567-0e02b2c3d489",
"agent": {
"agentId": "50123456789",
"agentSignature": {
"signatureInput": {
"created": "1735689600",
"keyId": "poqkLGiymh_W0uP6PZFwdvez3QJT5SolqXBCW38r0U",
"alg": "Ed25519",
"expires": "1735693200",
"nonce": "e8N7S2MFd/qrd6T2R3tdfAuuANngKI7LFtKYI7=",
"tag": "credential-request"
},
"signature": "jdq0SqOwHdyHr9+r5jw3iYZH6aNGKijYp/EstF4RQTQdi5N5YYKD+mCT1HA1nZDsi6nJKuHxUi/5Syp3rLWBA=="
}
}
},
"consumer": {
"consumerId": "c48ac10b-58cc-4372-a567-0e02b2c3d489",
"countryCode": "US",
"languageCode": "en",
"consumerIdentities": [
{ "identityType": "USER_NAME", "identityValue": "johndoe123", "identityProvider": "PARTNER" }
]
},
"appInstance": {
"applicationName": "My Shopping App",
"ipAddress": "192.168.1.100",
"deviceData": { "type": "Mobile Phone", "manufacturer": "Apple", "brand": "iPhone", "model": "iPhone 15 Pro" }
},
"tokenId": "d48ac10b-58cc-4372-a567-0e02b2c3d489",
"assuranceData": [
{
"verificationEntity": "10",
"verificationMethod": "23",
"verificationResults": "01",
"verificationTimestamp": "1735690745"
}
],
"mandates": [
{
"mandateId": "mandate-12345",
"declineThreshold": { "amount": "500.00", "currencyCode": "USD" },
"effectiveUntilTime": "1767225600"
}
],
"transactionData": {
"transactionReferenceId": "txn-ref-12345",
"merchantName": "Best Buy",
"merchantUrl": "https://www.bestbuy.com",
"transactionAmount": { "transactionAmount": "99.99", "transactionCurrencyCode": "USD" },
"transactionReferenceIdType": "ENCRYPTED",
"encryptedInstruction": "eyJhbGciOiJSU0EtT0FFUC0yNTYiLCJlbmMiOiJBMjU2R0NNIn0.EncryptedKey.IV.Ciphertext.AuthTag",
"mandateReferenceData": [ { "mandateId": "mandate-12345" } ]
},
"purchaseType": "PURCHASE_HITL"
}'
Exit criteria A 200 response returns clientReferenceId, instructionId, and a payload object containing exactly one of signedPayload (unencrypted, JSON Web Signature (JWS)) or encryptedSignedPayload (encrypted, JWE), never both. For any other response code, see Errors and troubleshooting.
Example response
{
"clientReferenceId": "d48ac10b-58cc-4372-a567-0e02b2c3d489",
"instructionId": "f72bd91c-4a13-4c8e-9b2f-71c5d3e8a904",
"payload": {
"signedPayload": "eyJhbGciOiJSUzI1NiJ9...",
"network": "visa",
"panLastFour": "1111",
"panExpirationMonth": "12",
"panExpirationYear": "2028",
"paymentAccountReference": "V0010013819330972362282455516"
}
}
How to verify: Confirm instructionId is non-empty and that exactly one of payload.signedPayload or payload.encryptedSignedPayload is populated.
A single instruction can hold multiple mandates spanning multiple merchants (for example, one combined budget split across two merchants, or separate per-merchant budgets under one consumer authorization). Request the first credential via this endpoint, then use "Retrieve a subsequent payment credential" for each additional mandate under the same instructionId.
How to test
- Complete card enrollment first so you hold a vProvisionedTokenID and device-bound Visa Payment Passkey for the consumer.
- Build the request with all required fields, choosing a purchaseType that matches the flow under test (PURCHASE_HITL, PURCHASE_AUTONOMOUS, or PURCHASE_RECURRING).
- Send POST /vacp/v2/credentials-for-instruction over mTLS and confirm a 200 response.
- Confirm the response contains a non-empty instructionId and exactly one of payload.signedPayload or payload.encryptedSignedPayload.
Persist these fields
- instructionId (required for every subsequent credential, confirmation, or cancel call against this instruction)
- The mandateId for each mandate created (required to reference the correct mandate on later credential retrievals)
- payload.paymentAccountReference, when present (not guaranteed to be returned, but useful for reconciliation if it is)
Beyond this response check, you know your integration works end-to-end when:
- You can complete an authorized commerce transaction at a merchant site within the limits of the consumer's mandate using the returned credential.
- For recurring flows, a subsequent credential retrieval call against the same instructionId resolves correctly without re-enrollment.
Retrieve a subsequent payment credential
Journey steps
- The instruction already exists and is ACTIVE (established via the Credentials for Instruction API).
- The agent identifies that an additional mandate under the same instruction needs a credential (for example, a multi-merchant or travel pattern such as booking a flight and a hotel as separate credentials under one instructionId).
- The agent calls this endpoint with a fresh agentSignature and encryptedInstruction, tied to exactly one mandateId.
- For non-recurring instructions, re-authentication may be required first if the consumer's original authentication is more than one week old (see Register Passkey). Recurring instructions are exempt for the life of the instruction.
Neither agentSignature nor encryptedInstruction may be reused from a prior call. assuranceData is not part of this request.
A single instruction can apparently span multiple payment credentials (for example, drawing one mandate against one card and a second mandate against a different card).
Exit criteria A 200 response with a new credential payload (same shape as the Credentials for Instruction API) for the requested mandate. The instruction remains ACTIVE.
How to test
- Start from an ACTIVE instruction with at least one additional mandate that has not yet had a credential retrieved.
- Build the request with a fresh agentSignature, a fresh encryptedInstruction, and the target mandateId.
- Send POST /vacp/v2/instructions/{instructionId}/credentials and confirm a 200 response.
- Confirm the response contains exactly one of payload.signedPayload or payload.encryptedSignedPayload, and that the instruction status remains ACTIVE.
Persist these fields
- payload.paymentAccountReference, when present (same caveat as the Credentials for Instruction API: not guaranteed to be returned)
- The mandateId used for this call, if you track per-mandate credential history client-side
Confirm transaction events
Journey steps
- The agent submits the retrieved credential to the merchant checkout flow.
- The agent attempts the transaction.
- The agent learns the outcome of the purchase, shipping, or payment event.
- The agent reports that outcome to Visa via this endpoint. This is required before Cancel can be called if a credential was retrieved, and is especially relevant when an instruction has multiple mandates, since each mandate's disposition is reported independently.
- If every mandate on the instruction is now complete, the agent sets instructionCompleted = true to close out the instruction.
instructionCompleted is optional at the top level.
Exit criteria A 200 response echoing clientReferenceId. Instruction status becomes COMPLETED if instructionCompleted = true. Otherwise, it remains ACTIVE. Each mandate's status reflects the submitted mandateReferenceData.status.
Setting transactionStatus = CANCELLED on a confirmationData entry is not the same as calling "Cancel the instruction". Setting transactionStatus = CANCELLED makes that specific tokenized credential unusable for further transactions, but the instruction itself remains ACTIVE and can still be drawn against for other mandates.
How to test
- Retrieve a credential first (via the Credentials for Instruction API or Retrieve a subsequent payment credential).
- Submit a confirmationData entry referencing that transaction's transactionReferenceId.
- Set transactionStatus to APPROVED, DECLINED, PENDING, ERROR, or CANCELLED to match the outcome you are testing.
- Confirm the response echoes your clientReferenceId with a 200 status.
- Once every mandate is fulfilled, resubmit with the top-level completion flag set to test instruction completion.
- Confirm the instruction transitions out of ACTIVE.
Persist these fields
Nothing from this call is required as input to a later call, other than being a completed prerequisite before you can call Cancel.
Cancel the instruction
Journey steps
- The instruction must be ACTIVE. Cancel is rejected for any other status, including PENDING, INPROGRESS, or COMPLETED.
- The agent calls Cancel to close out the instruction entirely (for example, because the consumer revoked authorization or the purchase instruction is no longer needed).
Confirmation precedes cancellation: Cancel only succeeds while the instruction is ACTIVE. If a credential has been retrieved, Visa requires you to report its outcome via "Confirm transaction events" first (both the retrieved credential's transaction status and the instruction's ACTIVE status must be resolved before Cancel is accepted).
Exit criteria Instruction status becomes CANCELLED (terminal). No further credential retrievals are permitted for it. Already-issued credentials remain valid for the merchant despite the cancellation.
How to test
- Confirm the instruction is currently ACTIVE.
- Send PUT /vacp/v2/instructions/{instructionId}/cancel with clientReferenceId, client, and appInstance.
- Confirm the response reflects instruction status CANCELLED, and that a repeat call against the same instructionId is rejected.
Persist these fields
Nothing (cancellation is terminal). Do not reuse this instructionId for further calls. Create a new instruction via the Credentials for Instruction API for any replacement purchase.