Connect a versioned AgentKit payer to a QuickPay product, then trace approval, wallet broadcast, merchant confirmation, and delivery.
Layer | Interface | Who owns the decision |
|---|---|---|
Wallet | AgentKit wallet provider backed by a configured signer | The buyer's application and signer approve the exact transfer. |
Identity | Optional ERC-8004 metadata lookup through AgentKit | The application decides which registration and seller evidence to trust. |
Payment and orders | AgentKit PayKit on the buyer side and GOAT Flow QuickPay on the merchant side | The buyer submits an approved payment. The merchant verifies its own order record. |
Confirmation | Evidence from the network selected for payment | The network records the transfer. The merchant applies its confirmation and delivery rules. |
A GOAT AgentKit payment flow can use the public PayKit product action to pay for a fixed GOAT Flow QuickPay offer. Use a trusted merchant link, discover the available product and payment terms, and invoke the action with an authorized wallet on a supported chain. Keep the resulting operation and payment references through to the merchant's verified order. ERC-8004 can inform which agent or service the application selects before it pays.
The walkthrough below uses one hypothetical downloadable data report. The interface names come from the published AgentKit 0.3.0 package and the official PayKit documentation. The recorded walkthrough at the end uses a local fixture. GOAT Network AgentKit PayKit reference
Define the purchase at the point of approval
Imagine an operations agent buying an hourly wind-history report for an industrial site. The agent needs the report for a planning task, while its operator owns the wallet policy. The merchant sells a fixed edition as a QuickPay product with a stable product key. In this example, the key is wind-hourly-v3. The price covers one edition and access to a downloadable artifact. Give the offer a clear output format, freshness date, retrieval window, and support contact before asking the buyer for payment authority.
The buyer's starting identifier should be a merchant link received through a trusted channel. Save the expected merchant, product key and delivery arrangement in the application. A link embedded in arbitrary agent output deserves independent validation before becoming a payment destination. Resolve the product and available rails through the documented public discovery interface. Choose one supported network and identify the asset by its contract on that network. A token ticker helps a human recognize the asset, but its contract distinguishes the token the wallet will actually send.
Capture what the buyer approved. A minimal approval record references the merchant, the trusted origin, the product and edition, an amount in the token's base units, the asset contract, the destination and a validity deadline. It also identifies the maximum debit under that approval and the party authorized to retrieve the file. Payment and entitlement records can describe different people. An agent's wallet can pay for a report that is delivered to its operator through the merchant's authorized channel.
On the merchant side, use a configured fixed-price QuickPay Product and confirm the intended payment rail in the appropriate environment. Ask the merchant for the public agent entry. For a controlled Testnet3 run, use the merchant's entry from that environment and the terms it advertises. Testnet3 describes the merchant deployment here. The actual payment network and token come from the selected supported terms, so derive both from the active configuration. Mainnet addresses, instruments and API credentials belong to their own environment. GOAT Flow QuickPay guide
Before coding, establish how the buyer will prove a purchase to the merchant without sending secrets. A checkout handle may allow access to a payment view, and a signed receipt can authorize access in a receipt-gated system. These deserve a different retention policy from an internal ticket number. For this example the purchase trace exposes a merchant correlation reference to support, stores the private recovery material separately, and keeps the expected product and asset alongside both.
Wire a buyer client for a single QuickPay product
Pin the buyer application to @goatnetwork/agentkit@0.3.0 for this reference. Record the lockfile version and the installed wallet dependencies in an integration run. The registry version identifies code that can be obtained and inspected. Successful signing, RPC access and the merchant's payment capability depend on your environment. Confirm each of those with the same configuration used in the run. AgentKit 0.3.0 package metadata
Create a wallet provider from a signer and an RPC provider with access to the intended network. The packaged EvmWalletProvider has a broadcast method for ERC-20 transfers. Use an appropriate signer and fund it with the asset and network gas only in an authorized environment. A provider that only reads balances can help with preparation. The write path needs a wallet capable of signing and submitting the actual transfer.
Configure an AgentKit runtime and register the PayKit action definitions. Allow the chosen chain context in the runtime and restrict the service to the same chain. Persist the recovery store between process runs. The source describes a file-backed store for a single host and a store interface for deployments that need shared recovery. A container that loses its local disk on restart can lose the very operation record you need to resolve a timeout. Give the store suitable access permissions and make its lifetime match the checkout and dispute window.
The TypeScript fragment assumes that the application supplies a configured ethers signer and provider, merchant URL, verified asset contract and chain, private journal path, plus a purchase already approved by the operator. Populate those values from your own approval and configuration. The discovery action lets the buyer inspect a merchant without submitting funds. Compare its returned product and rail with that approval before calling the payment action.
Use a buyer wallet provider on this side of the integration. The public PayKit path uses the seller's public entry and compatible token transfer. Agents do not receive the merchant account's HMAC secret. A seller using a custom authenticated gateway might integrate an AgentKit MerchantGatewayAdapter and a corresponding wallet adapter. The official payment guide supplies a typed-data sequence for that kind of integration. Check that gateway's routes, signature contract and statuses directly before selecting it. AgentKit payment adapters
There is also a useful limit on how far to generalize the runtime wiring. Discovering a product from a different platform, viewing an agreement in a browser, and opening a GOAT Flow agent entry are different capabilities. Check support for the exact URL with the PayKit buyer you're running. When a merchant offers Card, the compatible Card action arranges a hosted link and the buyer completes the payment and any authentication there. The example continues with the supported Crypto product action.
Run payment and status as separate steps
Once the operator has approved the current terms, give the purchase a stable operation key. Generate that key from the application purchase intent and keep it across retries of that purchase. A completed payment, a payment still waiting for confirmation and a new purchase for another report should never share ambiguous ownership of a key. The purchase record should show how the key maps to the approved quote, even if the buyer makes a second independent purchase for the same product later.

The following fragment continues the earlier setup. The application performs the actual terms checks and holds the signing authority until it can release this approved payment. confirmed: true satisfies the action's confirmation input. Derive it from the operator's decision so the model cannot set it merely because it wants a report.
The product action resolves the merchant-configured offer. The seller and buyer should compare the authorized amount and recipient with the terms sent to the wallet. Bind the signing policy to those values, especially if the merchant updates its offer between the operator's approval and execution. A price change requires a fresh approval or a decision already permitted by the authorization. A signer that independently checks the actual request helps preserve that condition if the application has a stale quote.
The client has more than one way to become uncertain. An HTTP request can time out before reaching the merchant. A reply containing the session can disappear after creation. The wallet can submit the transfer and then lose its response, or the transfer can stay pending while the buyer sees a timeout. The stable intent key and durable original operation record let the client check or recover the same attempt. Treat any confirmed transaction record as an observation about that attempt, and keep the responsible party visible when a result is uncertain.
If the SDK provides a recovery reference, store it in the approved purchase record. For the public product flow, use the documented session status action with the original session ID or operation ID according to the journal state. Where supported, pass the original expected fingerprint with the operation lookup. A lookup using a known session can read its state while keeping transfer authority closed. Recovering by operation ID can involve the SDK's own idempotent creation recovery if the session handle was lost. Preserve the original key and context in either case. Keep the recovered payment associated with the same offer.
A public session can return PAYMENT_CONFIRMED under the documented QuickPay path. Keep unknown, expired and failed states separately observable. If the wallet may have sent funds before the checkout expired, reconcile the original transfer with the merchant before creating a replacement. Use the appropriate chain record when a reliable transaction hash is available. The merchant's status reading and the buyer's RPC view can update at different times.
Read identity and preserve the transaction record
An optional ERC-8004 read can take place before quote acceptance. For this report, suppose the application already knows the seller's published registry reference. It uses AgentKit's documented identity read path to resolve metadata for that reference. Save the registry chain, contract and agent ID together. A numeric ID can exist under many registries. If you rely on a wallet address recorded for the agent, determine whether it represents the merchant destination for the actual purchase under the merchant's terms. The application still names and authorizes the selected recipient for the wallet transfer. AgentKit ERC-8004 guide
Give the identity observation its own line in the evidence record. If the read returns metadata for the expected registry entry, mark the identity lookup successful. Missing metadata, a changed endpoint or a conflicting registered address calls for a separate approval decision. The payment path should be able to proceed with an authorized merchant relationship even when the application does not require a registry lookup. Make that choice explicit in buyer policy.
Now preserve the proof from each system. From the buyer runtime, keep the action name, safe result status, trace and operation key. From the wallet or chain view, record the chain identifier and any transaction reference. Check that the confirmed movement matches the expected contract, recipient and amount. For the merchant, use the recognized transaction and product/order references to find the corresponding order and inspect the release status. Store the merchant's delivery result separately, with the artifact version attached. Avoid placing private journal content, URLs granting access, or signing material in customer-visible logs.
Observation | A useful record | Who can verify it |
|---|---|---|
Identity lookup | Registry, agent ID and metadata check | Application using the chosen registry |
Agent approval | Product, terms, expiry and decision reference | Buyer operator and policy service |
Wallet submission | Chain, transaction reference and intended token transfer | Buyer signer and selected network |
Merchant confirmation | Matching QuickPay order with the actual terms and status | Merchant Portal or trusted backend |
Delivery | Artifact edition and a usable access grant | Merchant fulfillment system and authorized buyer |
The payment chain determines which transfer can be verified. GOAT Network documents distinct milestones for L2 inclusion, publication to Bitcoin and further confirmation. Apply those milestones when the transfer actually runs on GOAT Network. When the chosen asset moves on another network, record and use that network's confirmation evidence. Keep the payer runtime's completed status and the merchant's decision to allow delivery visible as separate entries in either case.
The merchant then checks for any remaining fulfillment restrictions and delivers the report through its agreed channel. If QuickPay says the transfer was received while the merchant's storage job is still queued, keep the delivery as pending. Assign one job to the merchant order and version so repeated observation of payment has the same effect. Record the retrieved file or delivery acknowledgment when it arrives. A buyer whose client crashed during payment should be able to return to the order rather than reconstruct the sale from the chat transcript.
Give the two teams an explicit handoff record before the trial. For the example report, the buyer stores its order reference and the agreed artifact version at approval. When the verified payment appears, the merchant records that version alongside its own order identifier. A strong reconciliation run includes one transaction showing the expected transfer, that merchant order, and a successful retrieval of the same file edition. If the seller later reuses the product page to advertise a new edition, the old order and file version should still match. A second purchase for the new edition has a different approval and operation key. Keep these joins in the underlying systems so support can reconstruct them without opening the payer's private journal.
Rehearse the purchase with a fake wallet and merchant
A local fixture can demonstrate bookkeeping before anyone configures a funded wallet. Its output is also useful when the client engineering and merchant teams disagree about the owner of a state. The fixture accompanying this article prepares a fake environment, token and merchant address. It accepts one approval, counts a simulated wallet invocation, and drops the client response. A status lookup of the original operation still finds the order. After the fake merchant marks it confirmed, the fixture applies the delivery gate twice and retains one delivery.
Step | Local observation |
|---|---|
Resolve an identity reference | Test registry |
Approve the purchase | Product |
Drop the submission reply | One fake broadcast and one known operation and order. |
Look up the original order | Pending before the fake confirmation. Zero deliveries at that stage. |
Confirm and process again | The same order becomes confirmed. One simulated signing call and one delivery across repeats. |
The fixture uses a small fake merchant and simulated signer. It checks that the application can preserve and reuse its own records after an interruption. It runs without AgentKit, a real RPC or a merchant account. The code fragments above show the versioned integration shape. Match it to your application wiring and run its actual payment calls only in an approved environment.
For a subsequent Testnet3 trial, record the exact installed SDK and adapter, the merchant environment, and the chain and asset accepted by its active entry. Log successful discovery and the terms acknowledged by the buyer. Submit a test payment against one identified product and preserve the original operation key. Locate the transfer on the selected network and find the corresponding merchant order. Attach the safe test result and the observation time to the delivery record. Repeat the interrupted client exercise using the same test intent and observe whether it can resume without a second payment.
Treat discrepancies as separate problems. If the buyer and merchant agree on the order but the report is missing, inspect delivery. If the network shows a valid transfer and the merchant still reports pending, preserve the payment evidence for support and investigate the merchant match and required confirmations. If discovery returns a different product environment or the wallet rejects the payment, stop before creating another spend attempt. The integration test is complete when the customer can retrieve the promised report and both sides can reconstruct how that exact purchase was approved and paid.
FAQ
Does a public QuickPay buyer need a merchant API secret?
The documented public PayKit buyer uses the trusted merchant entry and its own authorized wallet. Merchant HMAC credentials belong to supported authenticated merchant integrations and should stay on the merchant side.
Is ERC-8004 registration required before buying a QuickPay product?
The example's identity lookup is optional. It gives the application a registry record to evaluate before purchasing. Wallet policy and the approved payment terms determine spending authority.
Can the same example use Card?
An eligible merchant can offer Card on hosted surfaces. A compatible agent can create the hosted link and the buyer completes payment and any authentication in the provider's interface. Use the merchant's corresponding provider-backed result to confirm the order.
What should I preserve after a timeout?
Keep the original operation key and context, known session or order reference, transaction reference if available, and any private SDK recovery record. Use the supported lookup or recovery path to resolve that payment before initiating a separate one.



