{"version":1,"resources":["https://stable-merch-gds0imbwo-merit-systems.vercel.app/api/ucp/checkout-sessions/{checkoutSessionId}/complete","https://stable-merch-gds0imbwo-merit-systems.vercel.app/api/ucp/carts","https://stable-merch-gds0imbwo-merit-systems.vercel.app/api/ucp/carts/{cartId}","PUT https://stable-merch-gds0imbwo-merit-systems.vercel.app/api/ucp/carts/{cartId}","https://stable-merch-gds0imbwo-merit-systems.vercel.app/api/ucp/carts/{cartId}/cancel","https://stable-merch-gds0imbwo-merit-systems.vercel.app/api/ucp/checkout-sessions","https://stable-merch-gds0imbwo-merit-systems.vercel.app/api/ucp/checkout-sessions/{checkoutSessionId}","PUT https://stable-merch-gds0imbwo-merit-systems.vercel.app/api/ucp/checkout-sessions/{checkoutSessionId}","https://stable-merch-gds0imbwo-merit-systems.vercel.app/api/ucp/checkout-sessions/{checkoutSessionId}/cancel","https://stable-merch-gds0imbwo-merit-systems.vercel.app/api/ucp/orders/{orderId}"],"mppResources":["https://stable-merch-gds0imbwo-merit-systems.vercel.app/api/ucp/checkout-sessions/{checkoutSessionId}/complete"],"description":"UCP custom merch API for making custom shirts, heavyweight shirts, and mugs from provided images. Agents create UCP carts that contain Printify preview media for the client UI to render, then complete x402 or mpp checkout after approval. Supports optional referral commissions added on top of the base price.","instructions":"\n# StableMerch API\n\nStableMerch implements UCP Shopping for custom shirts, heavyweight shirts, and mugs from buyer-provided images. The UCP profile is at /.well-known/ucp and the UCP REST service endpoint is /api/ucp.\n\n## Products\n\nProduct IDs are:\n- shirt\n- heavyweight-shirt\n- mug\n\nUse GET /api/ucp/catalog, or GET /api/catalog, to inspect supported variants, options, and base prices before creating a cart.\n\n## Preferred Flow\n\n1. POST /api/ucp/carts with SIWX to create a preview cart.\n   StableMerch supports one custom merch line item per cart. Use line_items[0].item.id for the product ID and quantity 1. Put custom artwork/options in dev.stablemerch.customization:\n   - client_request_id: idempotency key for this exact cart input\n   - image_url: HTTP/HTTPS URL or base64 data URL\n   - size, color, placement when applicable\n   - optional commission_address and commission_rate\n\n2. Return the cart object to the client. The client UI renders cart.line_items[0].item.image_url and totals. Agents should not download preview images, paste preview URLs, or narrate preview status in chat. Do not ask for shipping/contact details or payment before the user approves the client-rendered preview.\n\n3. POST /api/ucp/checkout-sessions with SIWX after preview approval. For the low-hop path, include cart_id plus UCP buyer and fulfillment in this same request. StableMerch then prepares the Printify manual-approval order and should return ready_for_complete. If a client creates an incomplete checkout first, PUT /api/ucp/checkout-sessions/{id} later with buyer and fulfillment.\n\n4. POST /api/ucp/checkout-sessions/{id}/complete with x402 or mpp only when checkout.status is ready_for_complete. Body may use { \"id\": \"<checkout id>\" } for UCP-style clients or { \"checkout_session_id\": \"<checkout id>\" } for AgentCash checkout-completion clients. The x402/MPP challenge is the source of exact payment terms.\n\n5. Use GET /api/ucp/orders/{orderId} to retrieve the completed UCP order after checkout completion.\n\n## Fulfillment Requirements\n\nCheckout create/update accepts UCP buyer plus fulfillment. StableMerch requires buyer.email and a selected shipping destination with:\n- first_name/last_name or full_name\n- phone_number\n- address_country, address_region, street_address, address_locality, postal_code\n- optional extended_address\n\n## Recovery\n\nUse GET /api/ucp/carts/{id} to recover pre-checkout preview state. PUT the same cart body to retry a failed retryable preview. Create a new cart to change product, artwork, or options after preview generation. Cancel with POST /api/ucp/carts/{id}/cancel before checkout, or POST /api/ucp/checkout-sessions/{id}/cancel before completion. Do not call old draft or direct product endpoints.\n"}