# Moustache Coffee Club agent checkout Buy freshly roasted specialty coffee, prepaid coffee gifts, or a paid recurring subscription through the customer agent interface. Website customers use the same purchasing, billing, and fulfillment services. ## Discover products and current capabilities 1. GET https://www.moustachecoffeeclub.com/agent_commerce for current input fields, limits, purchases_enabled, payment_setup_required, and stripe_profile_id. Check this response before starting a new purchase. 2. GET https://www.moustachecoffeeclub.com/agent_commerce/catalog for offered coffees, gifts, and subscriptions. Follow next_after_id with ?after_id=... until it is null. Catalog availability does not reserve inventory, and catalog prices are not a checkout quote. 3. Obtain a server quote for the selected purchase. Amounts are integer minor units (USD cents); never substitute a guessed total or advertised starting price. Use Content-Type: application/json for every JSON POST request. ## Customer identity For a new customer, POST JSON to https://www.moustachecoffeeclub.com/auth/agent/customers with email and optional firstname and lastname. This creates an ordinary MCC customer and returns access_token, token_type Bearer, and expires_in. The customer does not choose a password during agent signup. Use the customer's real contact email for recovery. An existing email cannot be used to obtain that customer's credentials through signup. Existing customers must connect their customer account. Customer MCP is https://www.moustachecoffeeclub.com/mcp, with OAuth discovery at https://www.moustachecoffeeclub.com/.well-known/oauth-protected-resource and https://www.moustachecoffeeclub.com/.well-known/oauth-authorization-server. Send Authorization: Bearer on authenticated JSON and MCP requests. Keep account tokens and payment credentials out of URLs, logs, analytics, and model-visible transcripts. ## Payment credentials The custom checkout accepts Stripe Shared Payment Tokens, not raw card numbers. Read MCC's current public stripe_profile_id from /agent_commerce and ask the customer's compatible wallet for an SPT targeted to that profile, covering the quoted currency, amount, and any required recurring allowance. A public seller profile is not a payment credential. MCC adds no separate human approval page. The wallet or issuer can still require customer approval or authentication. A compatible wallet credential is required; this interface does not promise that every agent or wallet can pay unattended. ## One-off coffee 1. POST /agent_commerce/coffee_quotes with sku_id, quantity: 1, and address. Address requires firstname, lastname, street1, city, state, zip, and country: "US"; street2 is optional. Use an offered SKU, not an invented size or arbitrary quantity. Only US shipping and USD are currently supported. 2. Request a wallet credential covering the quote's amount_cents and currency. 3. POST /agent_commerce/coffee_purchases with a new UUID request_key, the returned quote_token, and shared_payment_token. Use the same exact values if retrying this purchase. 4. GET /agent_commerce/coffee_purchases/{order_id} for this customer's order and payment status. Quotes expire after 15 minutes. An accepted order has its own destination without replacing the customer's default address. Checkout rechecks the quote and reserves stock. A pending payment is not a paid order. ## Prepaid coffee gifts 1. POST /agent_commerce/gift_quotes with plan_id, months, recipient_email, and optional message and send_date (YYYY-MM-DD). Choose an eligible plan/duration from the gift catalog. The response supplies amount_cents, currency, normalized gift details, and expiry. 2. Request a one-off wallet credential covering that exact amount and currency. 3. Call customer MCP /mcp with tools/call, tool name buy_gift, and arguments request_key (new UUID), plan_id, months, recipient_email, shared_payment_token, expected_amount_cents, expected_currency, plus the same optional message and send_date. Use the quoted amount/currency. Reuse the same request key, credential, and gift details on retry. The giver makes a one-off prepaid purchase. A confirmed paid gift becomes redeemable through the existing gift-claim journey. Pending or action-required payment is not a paid gift. send_date controls gift notification; it does not promise physical coffee delivery on that date. ## Recurring subscriptions 1. POST /agent_commerce/subscription_quotes with plan_id and shipping_address using the same address fields. Only paid US/USD recurring plans without trials are currently supported. 2. Read amount_cents, currency, cadence_weeks, and terms. Some legacy "monthly" plans use a four-week cadence; use the returned cadence rather than assuming a calendar month. 3. Obtain an SPT that supports recurring payments and enough allowance for every delivery within its spending period. 4. POST /agent_commerce/subscriptions with quote_token and shared_payment_token. Retry the same pair after an uncertain response. Subscription quotes expire after 30 minutes. Signup creates the subscription and schedules ordinary roast-day billing; payment_status: scheduled does not mean money was captured at signup. Future charges use the bound recurring source and normal account credits. Revoking a wallet token does not cancel the subscription; use the existing customer subscription-management tools. ## Results and retries Use a fresh request key only for a distinct intentional purchase. Reuse the exact request and original credential after a timeout or pending result. Existing accepted purchases can be recovered even when their original quote is now expired; a new purchase still needs a valid quote. Subscription signup uses its original quote/credential pair for replay. Read both HTTP status and the returned payment_status or MCP tool result. HTTP 202 means payment is pending. Do not report pending, requires-action, scheduled, or an unknown response as paid. Use order status or exact replay to reconcile the existing attempt before starting another. A price or offer change requires a fresh quote for a new purchase. Refunds, gift redemption, and delivery use MCC's normal customer/support flows. This custom API is not a claim of enrollment in every shopping assistant or a UCP/ACP integration.