LangChain's Restock Agent Pays for Real Orders Through Stripe's Link

LangChain has released Restock, a sample agent that finds products, builds a cart and pays for real orders from Slack. According to LangChain, it uses Stripe's Link wallet and the Machine Payments Protocol (MPP), so the model never sees card details.
- LangChain's Restock is a sample Slack agent on Managed Deep Agents that searches products, builds a cart and pays for real orders.
- Payment runs through Stripe's Link wallet and the Machine Payments Protocol, so the agent never sees a card number.
- The user approves twice, in Slack and in Link, and the agent cannot spend above the approved amount.
- In the example, a $25 budget and a $23 upfront payment led to a $22.18 charge and a $0.82 refund.
- Restock supports US delivery and USD only, with rehearsal, link-test and live modes.
What Restock does
Restock is a sample office-supply agent that runs in Slack on Managed Deep Agents (MDA). LangChain says it searches real products, builds a cart and checks out through an API that supports MPP. The company describes the project as a template for developers who want to build agents that spend money.
The blog post follows one request: a user asks for a 12-pack of blue ink pens for the office, under $25 altogether. Restock orders them for $22.18, fees included. LangChain notes that the prices in the post are illustrative.
The company frames the problem plainly: agents are already good at finding things to buy, but paying is harder because it moves real money, needs credentials the model should never see, and is hard to undo.
How the payment flow works
LangChain compares two ways to pay. An agent can drive a retailer's checkout in a browser, but that is fragile: pages change, sites block automated checkouts, and payment details must be entered without exposing them to the model. An MPP-enabled API avoids this by telling the agent exactly what to pay and accepting payment directly. The tradeoff is coverage, since the agent can only buy through MPP-enabled APIs. LangChain says that list is growing, with aggregators such as Apify and Mercator joining vertical providers like Zinc for retail. Restock uses Zinc.
Restock has four parts:
- Link, Stripe's consumer wallet, holds the user's payment methods and asks them to approve payments.
- MPP defines the payment exchange over HTTP. The merchant responds with 402 Payment Required and payment instructions, and the client retries with a payment credential.
- Zinc searches products and places retailer orders through its MPP order API.
- Managed Deep Agents hosts the agent and handles Slack, human review, credentials and saved state.
LangChain wrote custom tools for Zinc search, the cart and payment, plus instructions that shape the conversation. MDA saves conversations and orders, so a user can return days later and ask about the same pens.
Budgets, approvals and secrets
Restock treats the $25 budget as a ceiling, not an amount to charge. Tax and shipping are unknown from a product listing, so the agent asks the user how much to pay upfront, up to $25. In the example the user picks $23. Zinc keeps a $1 base fee, leaving a $22 retailer allowance for the item, tax and shipping. Zinc pays the retailer out of the upfront amount and refunds the rest. Optional fees can shrink the allowance, so Restock reads the actual fees from Zinc's 402 challenge before the review.
The user approves twice. First, in Slack, they review the cart, office label, fees and upfront amount. Restock raises an interrupt, so the run stays paused until the user clicks Approve or Reject, and LangChain says nothing the model writes into a tool call can approve it. Second, the user approves the exact amount on the Link website.
On secrets, the Link session lives in a user-owned MDA Connection, so each person's wallet stays theirs. The delivery address, notification email and Zinc API key sit in agent-owned Connections. The Link CLI runs in MDA's managed sandbox. After approval, Restock sends the paid request to Zinc with a Link shared payment token, and the payment tool deletes the token after use and returns only a public summary to the model. Because the token does not enforce cart details itself, the tool also checks the order against what the user reviewed and confirms the approval is still fresh.
In the example, the retailer order comes to $21.18: $14.99 for the pens, $1.20 tax and $4.99 shipping. The user pays $22.18 including Zinc's fee, and Zinc refunds $0.82. Restock confirms in Slack once Zinc reports order_placed, and shares tracking when the retailer ships.
Getting started and limits
The code is available at langchain-samples/restock-agent, with a README covering setup and deployment. LangChain says it ran Restock end to end on a hosted deployment: a live order reached order_placed and the expected refund came through.
Restock is a sample with limits: it supports US delivery and USD only, one office per deployment, and payment from the requester's own wallet. It has three modes, set with RESTOCK_MODE:
- rehearsal: fictional products and a simulated approval. It needs an OpenAI API key and a LangSmith workspace with Managed Deep Agents access.
- link-test: real Zinc search and a real Link approval, with no purchase. It adds a Link wallet, a Zinc API key, a funded Zinc search account and delivery details.
- live: a real payment and a real retailer order.
LangChain says the pattern carries over to any agent that spends money: let the agent search and build the cart, keep the spending limit and approvals in code the model cannot touch, and count an order as placed only when the merchant says so.

