# Agentic Transaction Flow
source: https://developer.mastercard.com/mastercard-agent-pay/documentation/use-cases/agentic-transaction/index.md

The Agentic Transaction flow enables a consumer-authorized AI Agent to securely discover, select, and purchase products on the cardholder's behalf using verifiable intent, authenticated consent, tokenized payments, and Mastercard Checkout Solutions (MCS).

In this model, a cardholder delegates purchasing authority to an AI-powered Agent. Depending on the use case, the cardholder may approve either:

* **Immediate Transaction:** The final product, merchant, amount, and purchase details are known and approved before execution. Immediate transactions use **closed mandates** that define the exact purchase details.

* **Autonomous Transaction:** The cardholder authorizes the Agent to act within predefined constraints such as spending limits, merchant restrictions, product categories, timing requirements, or delivery preferences. Autonomous transactions use **open mandates** that define the conditions under which a future purchase may occur.

### Transaction Lifecycle {#transaction-lifecycle}

Diagram agentic-flow

### How It Works {#how-it-works}

The Agentic Transaction flow consists of five major phases:

1. [Intent Creation and Approval](https://developer.mastercard.com/mastercard-agent-pay/documentation/use-cases/agentic-transaction/index.md#phase-1-intent-creation-and-approval)
2. [Cart Selection and Consumer Authentication](https://developer.mastercard.com/mastercard-agent-pay/documentation/use-cases/agentic-transaction/index.md#phase-2-cart-selection-and-consumer-authentication)
3. [Intent Registration](https://developer.mastercard.com/mastercard-agent-pay/documentation/use-cases/agentic-transaction/index.md#phase-3-intent-registration)
4. [Checkout and Payment Execution](https://developer.mastercard.com/mastercard-agent-pay/documentation/use-cases/agentic-transaction/index.md#phase-4-checkout-and-payment-execution)
5. [Authorization and Issuer Decision](https://developer.mastercard.com/mastercard-agent-pay/documentation/use-cases/agentic-transaction/index.md#phase-5-authorization-and-issuer-decision)

## Phase 1: Intent Creation and Approval {#phase-1-intent-creation-and-approval}

The cardholder defines a purchase objective and authorizes the Agent to act on their behalf.
**1. Define Purchase Intent:**   

The cardholder interacts with an Agent to create a purchase objective.
Depending on the scenario, the cardholder either:

* Specifies the final purchase details for an immediate transaction.
* Defines spending and purchasing constraints for an autonomous transaction.   

**2. Generate L2 Mandates:**   

The Agent generates the Level 2 (L2) mandates and submits them to the Agentic Commerce Provider (ACP) for review.

**3. Present Intent Details:**   

The ACP presents the intent details to the cardholder for review.

* **Immediate transactions** contain closed mandates that specify the final transaction details.
* **Autonomous transactions** contain open mandates that define the conditions under which future purchases may occur.  

**4. Approve Intent:**   

The cardholder reviews and approves the proposed intent and associated purchase terms.

**5. Sign the L2 SD-JWT:**   

The ACP unlocks the cardholder's private key and signs the L2 SD-JWT on the cardholder's behalf.

**6. Return Signed SD-JWTs:**   

The ACP returns the Level 1 (L1) SD-JWT and signed L2 SD-JWT to the Agent.

## Phase 2: Cart Selection and Consumer Authentication {#phase-2-cart-selection-and-consumer-authentication}

For autonomous purchases, the Agent identifies a suitable product and creates the final purchase details.
**7. Discover Products and Build Cart:**   

The Agent interacts with the Merchant, evaluates available products or services, and selects an appropriate purchase option.

**8. Generate and Sign the L3 SD-JWT:**   

The Agent finalizes the cart and generates the Level 3 (L3) SD-JWT containing the final purchase details. It then signs the L3 SD-JWT using the Agent key referenced in the L2 SD-JWT.

**9. Submit the SD-JWT Chain:**   

The Agent submits the complete SD-JWT chain (L1, L2, and L3) to the ACP.

**10. Initiate Authentication:**   

The ACP initiates authentication. If authentication is not required, the flow proceeds directly to checkout.

**11. Present Authentication Experience:**   

The ACP displays the MCS authentication experience to the cardholder.

**12. Authenticate the Cardholder**   

The cardholder successfully completes the authentication process.

**13. Receive Authentication Outcome**   

MCS returns:

* Authentication result
* Assurance data

The assurance data is carried forward into intent registration.

## Phase 3: Intent Registration {#phase-3-intent-registration}

When cardholder presence is required, the transaction is authenticated before checkout.
**14. Register the Verifiable Intent:**   

The ACP registers the Verifiable Intent with MCS using the [Verifiable Intent Registration](https://developer.mastercard.com/mastercard-agent-pay/documentation/api-reference/index.md#verifiable-intent) API.

**15. Validate the Intent:**   

MCS validates:

* SD-JWT signatures
* Spending limits
* Merchant restrictions
* Intent conditions   

**16. Receive Intent and Order IDs:**   

MCS returns:

* Intent ID
* Order ID These identifiers are used throughout the remainder of the transaction lifecycle.

## Phase 4: Checkout and Payment Execution {#phase-4-checkout-and-payment-execution}

The approved transaction is converted into a checkout payload and executed using tokenized payment credentials.
**17. Initiate Checkout**   

The ACP calls the MCS Checkout API and provides:

* Order ID
* Transaction amount
* Intent ID
* Merchant information

**18. Validate Checkout Information**   

MCS verifies that the checkout request aligns with the registered Verifiable Intent.

**19. Receive Checkout Payload**   

MCS returns a checkout payload containing:

* Tokenized payment credentials
* Order ID   

**20. Deliver Checkout Payload to the Agent**   

The ACP forwards the checkout payload to the Agent.

**21. Complete Merchant Checkout**   

The Agent presents the token credentials to the Merchant and completes checkout.

## Phase 5: Authorization and Issuer Decision {#phase-5-authorization-and-issuer-decision}

The payment request is authorized through the Mastercard network and evaluated by the Issuer.
**22. Submit Authorization Request**   

The Merchant submits an authorization request using the tokenized credentials.

**23. Identify Agentic Commerce Transaction**   

Mastercard identifies the transaction as an Agentic Commerce transaction and enriches it with Agentic Identifiers.

**24. Forward Authorization Request**   

Mastercard forwards the enriched authorization request to the Issuer.

**25. Return Issuer Decision**   

The Issuer approves or declines the transaction.

**26. Complete Authorization**   

Mastercard returns the authorization result to the Merchant, completing the transaction lifecycle.

## Next Steps {#next-steps}

Now that you understand the flow of an agentic transaction, explore the [API Reference](https://developer.mastercard.com/mastercard-agent-pay/documentation/api-reference/index.md#verifiable-intent) section to review the available endpoints and interact with them in the API Explorer.
