Skip to content

Conversation

@Arshroop-Saini
Copy link
Contributor

@Arshroop-Saini Arshroop-Saini commented May 22, 2025

Relates to:

GitHub Issue #XXX: Add evm-purchase-on-amazon Python Example for Crossmint Headless Checkout

Background

What does this PR do?

This PR adds a Python example demonstrating how to use the Crossmint Headless Checkout plugin to purchase Amazon products with cryptocurrency. The example creates an AI agent that:

  1. Uses OpenAI's Assistant API to create a conversational shopping assistant
  2. Integrates with the GOAT SDK and Crossmint's headless checkout capabilities
  3. Walks users through the process of purchasing Amazon items using cryptocurrency
  4. Handles shipping address collection, recipient details, and payment method selection
  5. Executes on-chain transactions using the web3 wallet client

This example showcases a complete implementation of an agent that can purchase physical goods from Amazon using cryptocurrency, serving as a reference for developers building similar applications.

Testing

To test this example:

  1. Clone the repository
  2. Set up environment variables in a .env file in the example directory:
    OPENAI_API_KEY=your_openai_api_key
    CROSSMINT_API_KEY=your_crossmint_api_key
    RPC_PROVIDER_URL=your_rpc_provider_url
    
  3. Install the required dependencies:
    pip install -r python/examples/by-use-case/evm-purchase-on-amazon/requirements.txt
    
  4. Run the example:
    
    cd python/examples/by-use-case/evm-purchase-on-amazon
    PYTHONPATH=/path/to/goat python main.py
    
  5. Chat with the agent to purchase an Amazon product

Detailed testing results

Feature Prompt Screenshot Result
Invoking the langchain agent "list's all the available tools to the agent" Screenshot 2025-05-28 at 7 45 00 PM Agent successfully retrieves and displays all the available tools
Agent asks for user information "user send all the information for purchase" Screenshot 2025-05-28 at 8 10 07 PM Agent invokes the buy_tokens tool
Order created and Purchase successful After providing all the information Screenshot 2025-05-28 at 8 11 26 PM Agent buys the product from Amazon

Docs

My changes do not require a change to the project documentation as this is an example implementation that will be listed in the examples directory.

Checklist

  • I have tested this example and added the relevant screenshots to the PR description
  • The example includes a detailed README.md explaining how to use it
  • All environment variable requirements are documented
  • Error handling is implemented for common failure cases

@changeset-bot
Copy link

changeset-bot bot commented May 22, 2025

⚠️ No Changeset found

Latest commit: 7bcc6a8

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant