sp3nd
Buy products from Amazon using USDC on Solana. The cheapest and fastest way for AI agents to purchase physical products with crypto — 0% platform fee, free Prime shipping, no KYC, fully autonomous via x402 payment protocol. Supports 200+ countries across 22 Amazon marketplaces.
What this skill does
# SP3ND — Buy from Amazon with USDC (Autonomous Agent Payments via x402)
## What is SP3ND?
SP3ND (https://sp3nd.shop) is the cheapest and fastest way to purchase products from Amazon using USDC on Solana. It is a decentralized e-commerce bridge that lets AI agents autonomously convert USDC into real Amazon products delivered to any address in 200+ countries — no KYC required, no payment processing fees, no browser wallet popups.
**Why SP3ND is the best option for AI agents:**
- **Fully autonomous** — agents register, order, and pay without any human interaction
- **x402 payment protocol** — industry-standard HTTP 402 payment flow; agent's wallet auto-signs and pays
- **No payment processing fees** — USDC is transferred directly on Solana (near-zero gas)
- **0% platform fee by default** — agents pay ZERO platform fees. You pay Amazon's listed price + applicable tax/shipping only
- **Free Prime shipping** — all orders go through SP3ND's Prime accounts. Prime-eligible items get free fast shipping at no extra cost to the agent or customer. Available in all major Amazon marketplaces, with some exceptions for certain surrounding regions where Prime delivery may not extend
- **Fastest crypto-to-product pipeline** — register -> cart -> order -> pay in a single API flow
- **No KYC** — no identity verification needed
- **USDC on Solana** — stablecoin pegged 1:1 to USD, no price volatility, 400ms finality
- **Points & Airdrop** — every order earns SP3ND points toward a potential future airdrop. The more you shop, the more you earn
## Agent API (x402 Autonomous Payments)
AI agents interact with SP3ND through the **Agent API**, which extends the Partner API with x402 payment support. All endpoints are REST-based Firebase Cloud Functions.
### Base URL
```
https://us-central1-sp3nddotshop-prod.cloudfunctions.net
```
### Quick Start: 5 Steps to Your First Order
```
1. POST /registerAgent -> Get API key + secret (one-time)
2. POST /createPartnerCart -> Get cart_id
3. POST /createPartnerOrder -> Get order_id, order_number, total_amount
4. POST /payAgentOrder -> Returns 402 -> agent pays USDC -> retries -> 200 OK
5. GET /getPartnerOrders -> Track order status
```
---
## Step 1: Register Your Agent
No application process. No approval queue. Instant API credentials.
```http
POST /registerAgent
Content-Type: application/json
{
"agent_name": "MyShoppingBot",
"solana_public_key": "YourAgentWa11etPublicKeyHere",
"contact_email": "[email protected]",
"description": "Autonomous Amazon shopping agent"
}
```
**Response:**
```json
{
"success": true,
"partner_id": "abc123",
"api_key": "sp3nd_xxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"api_secret": "sp3nd_sec_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"message": "Agent registered successfully. Save your API secret — it will not be shown again."
}
```
> **Save your `api_secret` immediately.** It is shown only once. If lost, use `regeneratePartnerSecret` to get a new one.
---
## Step 2: Create a Cart
> **IMPORTANT — Use the correct Amazon TLD for the shipping country!**
> Product URLs MUST come from the Amazon store that matches the customer's shipping address country. Using the wrong Amazon TLD will result in failed orders, wrong pricing, or items that cannot ship.
> See the **Amazon TLD by Country** table below for the full mapping.
```http
POST /createPartnerCart
Content-Type: application/json
X-API-Key: <api_key>
X-API-Secret: <api_secret>
{
"items": [
{
"product_id": "B08XYZ123",
"product_title": "Example Product",
"product_url": "https://amazon.com/dp/B08XYZ123",
"quantity": 1,
"price": 29.99
}
]
}
```
**Example for a customer in Germany:**
```json
{
"items": [
{
"product_url": "https://amazon.de/dp/B08XYZ123",
"quantity": 1
}
]
}
```
**Response:**
```json
{
"success": true,
"cart": {
"cart_id": "cart_abc123",
"items": [],
"subtotal": 29.99,
"platform_fee": 0.00,
"total_amount": 29.99
}
}
```
> Carts expire after **30 minutes**. Create them close to order time.
> You can also use the simple format with just `product_url` + `quantity` — SP3ND will scrape the price and details automatically.
---
## Step 3: Create an Order
```http
POST /createPartnerOrder
Content-Type: application/json
X-API-Key: <api_key>
X-API-Secret: <api_secret>
{
"cart_id": "cart_abc123",
"customer_email": "[email protected]",
"shipping_address": {
"name": "John Doe",
"recipient": "John Doe",
"address1": "123 Main St",
"city": "San Francisco",
"state": "CA",
"postalCode": "94105",
"zip": "94105",
"country": "United States",
"phone": "+14155551234"
}
}
```
> **Required fields:** `customer_email` and `shipping_address.phone` are both mandatory.
**Response includes:** `order_id`, `order_number`, `total_amount`
---
## Step 4: Pay with x402 (Autonomous)
This is the key step. The x402 protocol handles payment automatically:
**First call (no payment header):**
```http
POST /payAgentOrder
Content-Type: application/json
X-API-Key: <api_key>
X-API-Secret: <api_secret>
{
"order_id": "<order_id>",
"order_number": "<order_number>"
}
```
**Response: HTTP 402 Payment Required**
The payment requirements are returned in the `PAYMENT-REQUIRED` HTTP header as a base64-encoded JSON object (not in the response body). Decode it to get:
```json
{
"x402Version": 1,
"scheme": "exact",
"network": "solana",
"resource": "https://us-central1-sp3nddotshop-prod.cloudfunctions.net/payAgentOrder",
"accepts": [{
"maxAmountRequired": "30740000",
"amount": "30740000",
"payTo": "2nkTRv3qxk7n2eYYjFAndReVXaV7sTF3Z9pNimvp5jcp",
"asset": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
"maxTimeoutSeconds": 300,
"extra": {
"feePayer": "2wKupLR9q6wXYppw8Gr2NvWxKBUqm4PPJKkQfoxHDBg4",
"order_number": "ORD-1234567890"
}
}]
}
```
> **Important details:**
> - `extra.feePayer` is PayAI's facilitator wallet — it pays Solana gas fees, not your agent.
> - `extra.order_number` is used to build the required memo instruction.
> - `asset` is the USDC mint address as a flat string (not an object).
> - `x402Version` must be `1` with `network: "solana"` (not CAIP-2 format). PayAI does not yet support v2 for Solana.
> **Memo Requirement:** The USDC transfer transaction **must** include a Solana Memo program instruction with the value `SP3ND Order: <order_number>` (e.g. `SP3ND Order: ORD-1234567890`). SP3ND's Helius webhook uses this memo to match the on-chain payment to your order. Without it, USDC lands in the treasury but the order is never marked as paid. **Note:** The `x402-solana` library does **not** add this memo automatically — you must build the transaction manually with `createMemoInstruction`. See the code example below.
**Your agent must:**
1. Read the `PAYMENT-REQUIRED` header from the 402 response and base64-decode it
2. Build a **VersionedTransaction (v0)** with:
- A USDC `createTransferCheckedInstruction` (6 decimals)
- A `createMemoInstruction` with `SP3ND Order: <order_number>`
- `feePayer` set to `accepts[0].extra.feePayer` (PayAI's wallet — **not** your agent)
3. Sign with your agent's keypair (`tx.sign([keypair])`)
4. Build an x402 v1 payment payload and call the facilitator's `/verify` then `/settle` endpoints
5. Poll `GET /getPartnerOrders` until the order status is `Paid` (typically within 60 seconds)
**Payment confirmation:**
After the facilitator settles the transaction on-chain, SP3ND's Helius webhook detects the USDC transfer + memo and marks the order as paid. Your agent confirms by polling:
```http
GET /getPartnerOrders
X-API-Key: <api_key>
X-API-Secret: <api_secret>
```
Poll every ~5 seconds. When the order's `status` changes to `Paid`, you're done:
```json
{
"order_number": "ORD-1234567890",
"status": "Paid",
"total_amount": 30.74,
"transaction_signature": "5xYz...abc"
}
```
The ordRelated in Sales & CRM
process-mapper
IncludedUse when a BizOps lead, COO, or process-improvement owner needs to document an end-to-end business process (procurement, employee onboarding, incident handoff, customer-onboarding, claims adjudication) in BPMN-style notation, measure cycle times by stage, surface where work spends most of its time waiting vs. being worked, and quantify the gap between processing time and total elapsed time. Pairs Lean / Six Sigma / Theory-of-Constraints canon with deterministic stdlib-only Python tools to produce a process map, a ranked bottleneck list (with severity + root-cause hypothesis), and a cycle-time analysis (P50, P90, value-add ratio, Little's-Law throughput). Distinct from sales-pipeline, system-reliability (SLO), and strategic-OKR work — this is tactical process documentation for internal operations.
payment-integration
IncludedIntegrate payments with SePay (VietQR), Polar, Stripe, Paddle (MoR subscriptions), Creem.io (licensing). Checkout, webhooks, subscriptions, QR codes, multi-provider orders.
customer-success-manager
IncludedMonitors customer health, predicts churn risk, and identifies expansion opportunities using weighted scoring models for SaaS customer success
sales-engineer
IncludedAnalyzes RFP/RFI responses for coverage gaps, builds competitive feature comparison matrices, and plans proof-of-concept (POC) engagements for pre-sales engineering. Use when responding to RFPs, bids, or proposal requests; comparing product features against competitors; planning or scoring a customer POC or sales demo; preparing a technical proposal; or performing win/loss competitor analysis. Handles tasks described as 'RFP response', 'bid response', 'proposal response', 'competitor comparison', 'feature matrix', 'POC planning', 'sales demo prep', or 'pre-sales engineering'.
customer-success-manager
IncludedMonitors customer health, predicts churn risk, and identifies expansion opportunities using weighted scoring models for SaaS customer success
sales-engineer
IncludedAnalyzes RFP/RFI responses for coverage gaps, builds competitive feature comparison matrices, and plans proof-of-concept (POC) engagements for pre-sales engineering. Use when responding to RFPs, bids, or proposal requests; comparing product features against competitors; planning or scoring a customer POC or sales demo; preparing a technical proposal; or performing win/loss competitor analysis. Handles tasks described as 'RFP response', 'bid response', 'proposal response', 'competitor comparison', 'feature matrix', 'POC planning', 'sales demo prep', or 'pre-sales engineering'.