How to use Codex to build and test a Railbed checkout
Have Codex start from the checkout recipe for your project, then ask for evidence that the right order was paid and delivered once.
Use Codex to build a Railbed checkout by giving it a defined offer, pointing it at the checkouts.md recipe for your application, and asking it to prove a complete Test order. The project should show where the price comes from, which record proves payment, and what gets delivered. The merchant controls access, production release and the receiving wallet. A payment button that opens is not proof that the integration can deliver the right purchase.
Describe the purchase before asking for code
The first brief should name one thing people can buy. Tell Codex the customer, expected amount or price source and delivery rule. If you sell prepaid credits, describe whose account receives them. If you sell physical goods, say which order should be sent to the warehouse and when. If the business invoices a customer each period, distinguish the invoice from the period of access it covers. Railbed subscriptions bill by invoice each period, so your app must know how a verified invoice payment relates to the authorized access period.
A brief can be short: “Add checkout for our standard report bundle. The current catalog sets the price. The signed-in workspace gets the agreed bundle only after verified payment. Work in Test first. Show me the order and the delivery evidence before preparing a production change.” This is more useful than “monetize my app.” The specific offer gives a developer something to check. It also gives sales or support a plain explanation of what the buyer gets after the purchase.
If the app already sells, ask Codex to find the existing checkout and describe how it works before replacing anything. Trace one order from the button to the record that authorizes delivery. Note whether the store has other paths, such as historical invoices or a separate storefront, that should stay untouched. Replacing a button shouldn't remove information about earlier orders, and a new payment system cannot release funds held elsewhere. Start with one separately testable path. For the division of responsibilities, see what an AI agent can do to set up a payment gateway.
Start with the recipe that matches your app
Railbed maintains checkouts.md as an open format and playbook for agent-built checkout. The Railbed agent guide lists recipes for several frameworks and builders. Have Codex identify where the application runs server code, where it stores orders, and where it keeps authorized environment values. Then use the recipe for that stack. A static site with no backend doesn't automatically have the same options as an app that can create an order and verify a payment on a server. Choose a hosted offer if it fits, or plan the server work separately.
Ask Codex for a short account of what it found before it changes files: “This form starts the purchase, this service sets the price, this record tracks delivery, and these are the parts I propose to change.” Review it against the real product. A coding assistant can correctly recognize a framework and still misidentify which service owns the customer's account. In a repository with several applications, name the one that sells and keep the changes in the right project. If the current host is responsible for secrets, plan to use its normal controls rather than putting credentials into the source.
As the integration takes shape, have Codex update CHECKOUTS.md in the application root. Record the products and price authority, what happens after payment, the files or services involved, and dated evidence. Describe actual behavior, not intended behavior. Mark a step that wasn't observed as unverified. A future developer should be able to find the test and the fulfillment decision without the original chat. Read how to document payments for AI agents for how to organize that record.
Connect the project without putting secrets into chat
Railbed's agent docs describe an approved project connection that sends keys directly to the project environment after a person approves. Use the documented connection process for your stack. Choose Test first for the app integration. Review which business and environment the request is for, and authorize it only if you initiated it. Never paste the application key, a payment notification secret or a wallet recovery phrase into the conversation. Give the coding agent the names of the environment values and the host's documented way to store them, not the values.
Adding the official assistant connection to Codex is a separate task. Railbed documents setup for Codex in its MCP client guide. That connection is useful when Codex should check an authorized merchant record or prepare a supported change for a person to confirm in Railbed. Your deployed checkout doesn't use that chat connection as its runtime credentials. If you only need to build and prove the application path, don't give the assistant a Live business connection because it happens to be available. Review the application credentials and any assistant connection independently.
For example, a merchant can approve Test access for a staging app and give a separate read-only merchant connection to a staff member answering real order questions. The staging project can prove its own behavior without reading buyer data. The staff member can check a Live payment without deploying code or changing a checkout. A developer responsible for production may later approve the application's Live configuration. This arrangement is easier to troubleshoot than one broad connection used for every task by every person.
Save the order before handing the buyer to payment
The checkout should use a price the store can explain. Resolve the product or cart in your application, including discounts, tax and delivery where applicable. Save the terms, expected amount and currency before creating an order-specific checkout. Keep the customer account or workspace from your own records. A typed payment email isn't proof that a purchase belongs to that user. A company might have one person request the purchase and another pay, while the workspace belongs to neither individual personally.
If session creation is interrupted, keep the original attempt visible and follow the documented repeat-request behavior for the same order terms. A revised basket is a different decision. Show the revised total to the buyer and preserve the old terms, rather than silently changing the original attempt. If money later arrives for an older price, don't send the newer basket automatically. Send the mismatch to a person who can identify what the payment actually covered and how the business should honor it. The goal is to preserve the history staff need to resolve the exception.
For a fixed offer, avoid building order logic the sale doesn't need. If the business sells the same introductory session at one price and confirms bookings manually, a reusable hosted checkout can be a useful start. If the application must release a licensed feature to one signed-in workspace, choose a documented flow that ties payment to that workspace's order before the buyer leaves. Ask your coding agent to show the reason for its choice in the project record. Two buttons can look identical to a shopper while generating very different records for the business.
Prove fulfillment independently of the return page
Use verified payment evidence that matches the saved order. Railbed's fulfillment guide explains signed payment notifications and authenticated payment retrieval. The checkouts.md playbook uses a verified notification and a read of the provider's payment record before granting the purchase. Match the identifier, reference, amount, currency and mode. A thank-you page can show what the app knows. It can't decide that money arrived because a browser loaded the page. See how to verify an agentic checkout payment before delivery for the connection between order and confirmation.
Keep the fulfillment decision separate from the payment. Imagine a customer buys a fixed pack of reports and the grant service is unavailable when the payment comes in. The payment can be confirmed while the grant remains outstanding. The app should resume delivery against the existing purchase and add the bundle once. A second notification or a refresh does not authorize another grant. If this is a warehouse, use the order's own reference to stop a second shipment even if more than one payment attempt shows confirmation. Manage any actual extra payment separately.
In Test, see the same screens a buyer would see and the records a staff member would use. Ask the developer to show a paid example that delivers once, an unfinished example that grants nothing and a recovery example that handles a verified payment whose delivery was interrupted. Confirm that processing the same legitimate Test confirmation again doesn't grant the purchase twice. Make the developer show the actual delivery or access record, not just a console message. If they couldn't test one of these examples, document it and leave it open rather than claiming a complete result.
Use two reviewers if the integration is new
Have someone who knows the app confirm the order details and delivery. Have another person, or the same person playing a different role, confirm the buyer experience and what support can see. For a digital product, ask them to find the exact access that was granted. For a physical product, ask them to check the recorded items and order status rather than relying on an internal screen that turns green. This keeps the team from accepting a technical success that doesn't actually deliver what the buyer chose.
Give reviewers a short checklist they can repeat without Codex. They should be able to say which step created the order, what state would permit fulfillment and what happens when they close the browser early. They should also know who can look up an unresolved attempt. The test is useful if the result tells the next person what to do. A transcript with all the reasoning in it is not a substitute for a documented order state and a clear release rule.
Keep the production pilot narrow
Before release, confirm the exact eligible offer, the intended location and real buyer device types. In Railbed's card flow, the buyer enters payment details on the provider's page. Buyer ID checks depend on the provider. An app-specific session does not change who handles card entry or what checks apply. Test mode establishes how your integration reacts, not how often actual buyers complete the handoff. Show them what they bought, where they pay and how they can check status if the payment tab closes. For a store setup, see Railbed for ecommerce.
A high-risk store should test an eligible order that resembles the difficult business it actually does. Describe the product accurately, honor any restrictions that apply and keep ineligible orders out of the pilot. Don't tell the coding agent to bypass a buyer check, and don't choose another route solely to get around a decline. If the business normally processes more than $50,000 per month, bring representative order values, buyer locations and redacted order records to Railbed sales to walk through the buyer experience and the settlement evidence. For selection criteria, see the agentic gateway guide for high-risk stores.
Before switching more traffic, choose a stop condition your team can recognize. A verified paid order attached to the wrong account, a duplicate shipment or an ineligible sale on the route is enough to pause expansion and investigate. Keep the existing attempts available for lookup. Pausing new checkout doesn't change the status of a buyer who already started. Give support a way to distinguish “we are still checking” from “we received payment and are finishing delivery.” Neither message requires another payment link.
Verify proceeds with finance, not the browser
Railbed never holds funds. Card sales settle to a wallet the merchant controls, almost always as USDC on Polygon. Settled sales can't be pulled back from your wallet. That does not erase merchant obligations to handle refunds or buyer disputes. If your business needs a bank deposit, conversion and withdrawal are separate steps. Check the supported asset and network with the service you actually use and confirm the final receipt before relying on that path. See how to reconcile USDC settlements with bank withdrawals.
Ask finance to trace one eligible Live order when it becomes available. The order record shows what the buyer bought. The payment record confirms the matching payment. The fulfillment record shows what the business delivered. The wallet record establishes that funds arrived. If an accountant cannot trace the order to the wallet, mark the finance test unresolved even if the code works. Don't describe a Test payment as a wallet receipt, and don't describe a wallet receipt as money already present in the bank.
FAQ
Can Codex build a Railbed checkout for an existing app?
Yes. Give it the applicable checkouts.md recipe and ask it to identify the app's current order and delivery records first. Start with one path and prove the change in Test.
Do I need the Railbed assistant connector to deploy checkout?
The merchant assistant connection and your deployed application's payment credentials serve different jobs. Follow the project connection instructions for the app and use the assistant connection only for authorized record or proposal work.
Can I give Codex a secret key in chat?
No. Use the approved connection or the hosting platform's secret settings. Keep values out of chat, source files, exported logs and the project documentation.
What should I ask Codex to prove before release?
Ask it to show the saved order, the matching verified payment and delivery exactly once. Include an unfinished payment and a delivery interruption so you can see how each recovers.
Can the return page mark the order paid?
No. The return page can report status. Confirm payment from a trusted Railbed record and match it to the order before granting the purchase.
Will a custom integration remove buyer ID checks?
No. Buyer ID checks depend on the provider, and the buyer completes any required checks on the provider's page. The application should explain the handoff without collecting those details itself.
Does a successful Test payment prove my business has settled funds?
No. Test proves a simulated application workflow. A legitimate Live payment and matching wallet receipt are separate evidence, and any bank conversion or withdrawal must be checked independently.
What to check before moving the next offer
A useful Codex checkout has an order you can find, a payment you can verify and a purchase you can see was delivered once. Keep that evidence with the project. Let the assistant build and document the work, and let the business decide when the route is ready for more buyers.