<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Max</title>
    <description>The latest articles on DEV Community by Max (@max_leveling).</description>
    <link>https://dev.to/max_leveling</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F2730930%2F998aca5b-9acf-4b87-b46e-090f1c35ec6e.png</url>
      <title>DEV Community: Max</title>
      <link>https://dev.to/max_leveling</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/max_leveling"/>
    <language>en</language>
    <item>
      <title>Give Your AI a $5 Budget: Try x402 with a Real Order</title>
      <dc:creator>Max</dc:creator>
      <pubDate>Mon, 14 Sep 2026 14:27:04 +0000</pubDate>
      <link>https://dev.to/max_leveling/give-your-ai-a-5-budget-try-x402-with-a-real-order-48ae</link>
      <guid>https://dev.to/max_leveling/give-your-ai-a-5-budget-try-x402-with-a-real-order-48ae</guid>
      <description>&lt;p&gt;Most agent tutorials end with a tool call that prints JSON. What if yours ended with a real order and an assistant checking what happened after it paid?&lt;/p&gt;

&lt;p&gt;I recently added x402 support to GrowVib, the social media marketing platform I’m building. Here’s a small experiment you can build around it: compare services, approve a purchase within 5 USDC, and track the result.&lt;/p&gt;

&lt;p&gt;You’ll work through HTTP payment challenges, wallet signing, budget checks, and asynchronous fulfillment. Discovery and quoting can be explored without paying.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Disclosure: I build GrowVib. This is an integration walkthrough, not a promise of marketing results. Paid orders use real funds, and the snippets illustrate parts of the application rather than a complete runnable project.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  How the pieces fit together
&lt;/h2&gt;

&lt;p&gt;MCP gives the assistant tools for finding services and requesting quotes. x402 adds a payment step to an HTTP request. Your wallet signs the payment, and GrowVib uses &lt;strong&gt;PayAI as its facilitator&lt;/strong&gt; to verify and settle it.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Component&lt;/th&gt;
&lt;th&gt;Job&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;AI assistant&lt;/td&gt;
&lt;td&gt;Understand your requirements and explain options&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;GrowVib MCP&lt;/td&gt;
&lt;td&gt;Expose catalog and quote tools&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Buyer wallet and x402 client&lt;/td&gt;
&lt;td&gt;Sign and submit an approved payment&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;GrowVib&lt;/td&gt;
&lt;td&gt;Request payment and manage the service order&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;PayAI&lt;/td&gt;
&lt;td&gt;Verify and settle payments on GrowVib’s side. No buyer setup required.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Your application&lt;/td&gt;
&lt;td&gt;Enforce spending limits and remember order state&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;You do not need to run a facilitator to buy from GrowVib. Your buyer application needs a compatible x402 client and wallet signer.&lt;/p&gt;

&lt;h2&gt;
  
  
  What you need
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;A tool-capable AI assistant or coding assistant.&lt;/li&gt;
&lt;li&gt;A local Node.js/TypeScript application to coordinate the workflow.&lt;/li&gt;
&lt;li&gt;GrowVib’s public MCP connection or its documented HTTP API.&lt;/li&gt;
&lt;li&gt;An x402 v2 client with a compatible wallet signer.&lt;/li&gt;
&lt;li&gt;USDC on Base mainnet for the approved purchase.&lt;/li&gt;
&lt;li&gt;Persistent storage for approvals, budget reservations, and order references.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This guide focuses on Base. The 5 USDC budget covers service payments, while model usage, subscriptions, and wallet funding costs are separate.&lt;/p&gt;

&lt;p&gt;Use a target you control and a service you understand. Check the destination platform’s rules before ordering. Automating a purchase does not guarantee genuine audience interest, organic reach, or sales.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Compare services without paying
&lt;/h2&gt;

&lt;p&gt;Connect your compatible MCP client to:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;https://api.growvib.com/mcp-public
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Follow your client’s remote-MCP setup instructions. The &lt;a href="https://growvib.com/x402?utm_source=devto&amp;amp;utm_medium=referral&amp;amp;utm_campaign=x402_devto_post" rel="noopener noreferrer"&gt;GrowVib x402 documentation&lt;/a&gt; also links to the HTTP API.&lt;/p&gt;

&lt;p&gt;Try this prompt:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Help me compare GrowVib services without buying anything.

Platform: [platform]
Service type: [specific service]
Target URL: [a target I control]
Quantity: [quantity]
Audience requirements: [requirements or no preference]
Maximum wallet settlement: 5 USDC

Use the current tool schemas and actual catalog data.
Show up to three suitable options, with exact prices and
documented differences. Tell me if nothing matches.

Do not submit a paid request or sign any payment.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Use &lt;code&gt;search_catalog&lt;/code&gt; or &lt;code&gt;recommend_service&lt;/code&gt;, then &lt;code&gt;get_quote&lt;/code&gt;. Let the assistant read the current schemas instead of guessing arguments.&lt;/p&gt;

&lt;p&gt;Check that the proposal identifies the service, target, quantity, conditions, and price before continuing.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Inspect an HTTP 402 response
&lt;/h2&gt;

&lt;p&gt;This is an unpaid order request. Replace the placeholders with valid values from the selected service:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl &lt;span class="nt"&gt;-i&lt;/span&gt; &lt;span class="nt"&gt;-X&lt;/span&gt; POST https://api.growvib.com/v1/agent/orders &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-H&lt;/span&gt; &lt;span class="s1"&gt;'Content-Type: application/json'&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-d&lt;/span&gt; &lt;span class="s1"&gt;'{
    "service_id": "&amp;lt;selected-service-id&amp;gt;",
    "quantity": 1000,
    "link": "&amp;lt;authorized-target-url&amp;gt;"
  }'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The quantity is illustrative and must satisfy the service’s limits. A valid payable request without payment returns a &lt;code&gt;402&lt;/code&gt; challenge. Invalid inputs may return a validation error instead.&lt;/p&gt;

&lt;p&gt;Inspect the amount, asset, network, recipient, and expiration window.&lt;/p&gt;

&lt;p&gt;Use ordinary HTTP for this preview. A payment-enabled wrapper may automatically pay when it receives a challenge.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Set up the buyer client
&lt;/h2&gt;

&lt;p&gt;You need two things: an x402 client that speaks version 2 of the protocol, and a wallet signer it can use.&lt;/p&gt;

&lt;p&gt;You do not need anything from PayAI. In this flow, the buyer does not contact the facilitator. Your client signs a payment and sends it to GrowVib. GrowVib calls its facilitator to verify and settle, and the outcome comes back in GrowVib’s response.&lt;/p&gt;

&lt;p&gt;Version 2 is required. GrowVib puts the payment terms in a &lt;code&gt;PAYMENT-REQUIRED&lt;/code&gt; header and expects the signed payload in &lt;code&gt;PAYMENT-SIGNATURE&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;A version 1 client sends &lt;code&gt;X-PAYMENT&lt;/code&gt; instead. That request is rejected with a validation error. If you are evaluating a library, check which header it sends before anything else.&lt;/p&gt;

&lt;p&gt;Set it up in this order:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Configure the wallet signer locally and confirm the address it will pay from.&lt;/li&gt;
&lt;li&gt;Exercise the client against an endpoint you know supports it. GrowVib publishes no test endpoint, so treat this as a test of your client rather than of the integration.&lt;/li&gt;
&lt;li&gt;Configure Base mainnet and fund the paying address with USDC.&lt;/li&gt;
&lt;li&gt;Keep automatic payment switched off until the approval and budget checks work.&lt;/li&gt;
&lt;li&gt;Read the payment terms from GrowVib’s live 402 response. Do not hardcode an amount, asset, network, or recipient from an example, including this guide.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Keep the wallet key and any bearer token GrowVib returns out of chat transcripts, source control, and logs.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Make the $5 limit real
&lt;/h2&gt;

&lt;p&gt;“Never spend more than $5” states your intent. The application has to enforce it before signing anything.&lt;/p&gt;

&lt;p&gt;Track wallet settlements and account balance separately.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Wallet settlements:&lt;/strong&gt; USDC that has left your wallet. The 5 USDC cap applies to this total. Keep it across requests and application restarts.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Account balance:&lt;/strong&gt; Money that has already settled and now sits with GrowVib under your wallet address. Spending it debits that balance without a new on-chain settlement. Balance purchases still need approval for the exact order.&lt;/p&gt;

&lt;h3&gt;
  
  
  Use the balance you already paid for
&lt;/h3&gt;

&lt;p&gt;GrowVib sets a $1 minimum settlement while orders are priced according to the catalog.&lt;/p&gt;

&lt;p&gt;For example, an order costing $0.40 settles $1 when funded by a new minimum settlement. The remaining $0.60 stays as account balance.&lt;/p&gt;

&lt;p&gt;If you treat every small order as a fresh settlement, you can keep paying the $1 floor while leaving those remainders unused.&lt;/p&gt;

&lt;p&gt;A successful order response returns an &lt;code&gt;agent_token&lt;/code&gt;. To spend an available balance, send it as a bearer token with an &lt;code&gt;idempotency_key&lt;/code&gt; and no payment payload:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl &lt;span class="nt"&gt;-X&lt;/span&gt; POST https://api.growvib.com/v1/agent/orders &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-H&lt;/span&gt; &lt;span class="s1"&gt;'Content-Type: application/json'&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-H&lt;/span&gt; &lt;span class="s1"&gt;'Authorization: Bearer &amp;lt;agent-token&amp;gt;'&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-d&lt;/span&gt; &lt;span class="s1"&gt;'{
    "service_id": "&amp;lt;selected-service-id&amp;gt;",
    "quantity": 1000,
    "link": "&amp;lt;authorized-target-url&amp;gt;",
    "idempotency_key": "&amp;lt;your-unique-key&amp;gt;"
  }'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;idempotency_key&lt;/code&gt; is required on this path.&lt;/p&gt;

&lt;p&gt;A signed payment has retry protection tied to its authorization. A balance order has no payment signature, so the key prevents a timeout and retry from creating two orders and debiting twice.&lt;/p&gt;

&lt;p&gt;Generate one key per intended purchase. Reuse that key when retrying the same purchase.&lt;/p&gt;

&lt;p&gt;If the balance does not cover the order, the request returns an ordinary 402 challenge. Handle that as a new payment decision: inspect the settlement amount, check the remaining budget, and obtain approval before signing.&lt;/p&gt;

&lt;h3&gt;
  
  
  Check new settlements in code
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// Illustrative application logic, not x402 SDK code.&lt;/span&gt;
&lt;span class="c1"&gt;// USDC has six decimal places.&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;budget&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="nx"&gt;_000_000n&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;assertWithinBudget&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="nx"&gt;settled&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;bigint&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nx"&gt;reserved&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;bigint&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nx"&gt;requested&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;bigint&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;requested&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="nx"&gt;n&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;throw&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Error&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Invalid payment amount&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;

  &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;settled&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nx"&gt;reserved&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nx"&gt;requested&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;budget&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;throw&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Error&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Not enough budget remaining&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Persist the budget and reserve funds atomically before signing. Otherwise, two concurrent requests can pass the same check and overspend together.&lt;/p&gt;

&lt;p&gt;Bind approval to the service, target, quantity, network, asset, recipient, and amount. If any approved detail changes, ask again. Restrict payments to the intended API host.&lt;/p&gt;

&lt;h3&gt;
  
  
  Watch the expiry
&lt;/h3&gt;

&lt;p&gt;The payment terms expire, with a five-minute window by default. A manual approval can take longer than that.&lt;/p&gt;

&lt;p&gt;Get approval first, then request fresh payment terms. Compare them with the approved service, target, quantity, network, asset, recipient, and amount.&lt;/p&gt;

&lt;p&gt;If those details still match, sign within the new validity window. If they changed, ask again.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. Approve one purchase
&lt;/h2&gt;

&lt;p&gt;Keep the confirmation easy to review:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Service: [selected service]
Target: [approved URL]
Quantity: [approved quantity]

Order charge: [quoted amount]
Available GrowVib balance: [current amount]
Payment route: [account balance or new wallet settlement]
Wallet settlement: [required amount, or zero for a balance order]
Remaining settlement budget: [remaining amount]

For a new settlement:
Network: [network from live payment terms]
Asset: [asset from live payment terms]
Recipient: [recipient from live payment terms]

Approve this exact purchase?
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;These are placeholders for live values.&lt;/p&gt;

&lt;p&gt;For a balance order, submit the bearer token and the purchase’s idempotency key without a payment signature.&lt;/p&gt;

&lt;p&gt;For a new settlement, fetch fresh payment terms after approval, check that the approved details still match, and only then sign.&lt;/p&gt;

&lt;p&gt;Keep approval manual for the first version. You can learn the protocol without starting with unattended spending.&lt;/p&gt;

&lt;h2&gt;
  
  
  6. Track delivery after payment
&lt;/h2&gt;

&lt;p&gt;Here is an illustrative successful order response for the $0.40 example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"order_id"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"..."&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"tracking_code"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"..."&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"status"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"PENDING"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"charged_usd"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mf"&gt;0.40&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"balance_usd"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mf"&gt;0.60&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"payment_id"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"..."&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"agent_token"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"..."&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;charged_usd&lt;/code&gt; is the order cost. In this example, &lt;code&gt;balance_usd&lt;/code&gt; is the remaining $0.60, available for later orders without another settlement.&lt;/p&gt;

&lt;p&gt;Store both values, plus &lt;code&gt;order_id&lt;/code&gt; and &lt;code&gt;agent_token&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Read delivery status with the order ID and token:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl &lt;span class="s1"&gt;'https://api.growvib.com/v1/agent/orders/&amp;lt;order-id&amp;gt;'&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-H&lt;/span&gt; &lt;span class="s1"&gt;'Authorization: Bearer &amp;lt;agent-token&amp;gt;'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This read accepts the bearer token as its credential. A payment signature does not replace it.&lt;/p&gt;

&lt;p&gt;Without a token, you get a 401. Another account’s order returns 404.&lt;/p&gt;

&lt;p&gt;Lost an order ID? &lt;code&gt;GET /v1/agent/orders&lt;/code&gt; returns a page of your orders, newest first, with optional &lt;code&gt;status&lt;/code&gt;, &lt;code&gt;page&lt;/code&gt;, and &lt;code&gt;page_size&lt;/code&gt; parameters.&lt;/p&gt;

&lt;p&gt;Both reads are safe to poll. The endpoint is limited to 20 requests per minute per IP, so check periodically instead of running a tight loop. Respect &lt;code&gt;Retry-After&lt;/code&gt; and back off when rate limited.&lt;/p&gt;

&lt;h3&gt;
  
  
  Renew the token without paying again
&lt;/h3&gt;

&lt;p&gt;The token expires after an hour and is refreshed on every order.&lt;/p&gt;

&lt;p&gt;An application that keeps ordering within that window and saves the returned token can keep its credentials current. A daily digest, however, will need to renew its token.&lt;/p&gt;

&lt;p&gt;Sign in with the wallet instead of making another payment:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl &lt;span class="nt"&gt;-X&lt;/span&gt; POST https://api.growvib.com/v1/agent/auth/challenge &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-H&lt;/span&gt; &lt;span class="s1"&gt;'Content-Type: application/json'&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-d&lt;/span&gt; &lt;span class="s1"&gt;'{"address": "&amp;lt;your-wallet-address&amp;gt;"}'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The response contains a &lt;code&gt;nonce&lt;/code&gt; and a &lt;code&gt;message&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;For the Base wallet used here, sign the message bytes unchanged with &lt;code&gt;personal_sign&lt;/code&gt;, then exchange the signature:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl &lt;span class="nt"&gt;-X&lt;/span&gt; POST https://api.growvib.com/v1/agent/auth/token &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-H&lt;/span&gt; &lt;span class="s1"&gt;'Content-Type: application/json'&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-d&lt;/span&gt; &lt;span class="s1"&gt;'{"nonce": "&amp;lt;nonce&amp;gt;", "signature": "&amp;lt;signature&amp;gt;"}'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You receive a fresh &lt;code&gt;agent_token&lt;/code&gt; and the wallet’s current &lt;code&gt;balance_usd&lt;/code&gt;. This does not make a payment or an on-chain transaction.&lt;/p&gt;

&lt;p&gt;The nonce is single use, and a failed attempt consumes it. Request a new challenge for each attempt.&lt;/p&gt;

&lt;p&gt;A Solana wallet includes &lt;code&gt;"chain": "solana"&lt;/code&gt; in the challenge request and signs with &lt;code&gt;signMessage&lt;/code&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Handle these responses explicitly
&lt;/h3&gt;

&lt;p&gt;Payment success does not mean delivery is complete. Three responses deserve their own handling:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Response&lt;/th&gt;
&lt;th&gt;Meaning&lt;/th&gt;
&lt;th&gt;What to do&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;code&gt;202&lt;/code&gt;, &lt;code&gt;settlement_unresolved&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;Settlement is uncertain and money may have moved&lt;/td&gt;
&lt;td&gt;Save the payment reference and reconcile before attempting another purchase&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;code&gt;200&lt;/code&gt;, &lt;code&gt;credited_no_order&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;Payment settled, but no order was created&lt;/td&gt;
&lt;td&gt;Use the available balance, token, and an idempotency key to place the order&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;code&gt;409&lt;/code&gt;, &lt;code&gt;duplicate_order&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;An order for that link is already in progress&lt;/td&gt;
&lt;td&gt;Use the existing order identified in the response&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;For &lt;code&gt;settlement_unresolved&lt;/code&gt;, do not create a fresh signed payment. Record the &lt;code&gt;payment_id&lt;/code&gt; and check your order list. If you need a token, use the wallet sign-in flow above.&lt;/p&gt;

&lt;p&gt;An empty order list alone does not prove settlement failed. Keep the payment amount reserved while its outcome remains unresolved.&lt;/p&gt;

&lt;p&gt;For partial delivery or refunds, report what the API says. Refunds are credited to your GrowVib account balance, not returned to the paying wallet. Refunds are not automatic.&lt;/p&gt;

&lt;h2&gt;
  
  
  If the endpoint returns 404
&lt;/h2&gt;

&lt;p&gt;The x402 route returns 404 while it is switched off. Check &lt;a href="https://growvib.com/x402?utm_source=devto&amp;amp;utm_medium=referral&amp;amp;utm_campaign=x402_devto_post" rel="noopener noreferrer"&gt;GrowVib’s x402 documentation&lt;/a&gt; for current availability before assuming the URL is wrong.&lt;/p&gt;

&lt;p&gt;Depending on the request, a 404 can also mean an unknown service or an order that does not belong to the authenticated account.&lt;/p&gt;

&lt;h2&gt;
  
  
  What could you build next?
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Project&lt;/th&gt;
&lt;th&gt;Useful outcome&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Comparison assistant&lt;/td&gt;
&lt;td&gt;Explain suitable options before purchasing&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Client purchasing desk&lt;/td&gt;
&lt;td&gt;Keep budgets, approvals, and records separate&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Order digest&lt;/td&gt;
&lt;td&gt;Summarize existing orders and exceptions&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Repeat-order assistant&lt;/td&gt;
&lt;td&gt;Reuse requirements, obtain a fresh quote, and request approval&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;A scheduled digest needs a running application or scheduler. A chat does not keep checking orders after it ends.&lt;/p&gt;

&lt;p&gt;Start with one clear task and one approved purchase. Add automation after you understand how the workflow behaves when something goes wrong.&lt;/p&gt;

&lt;p&gt;The complete request and response flow is in the &lt;a href="https://growvib.com/x402?utm_source=devto&amp;amp;utm_medium=referral&amp;amp;utm_campaign=x402_devto_post" rel="noopener noreferrer"&gt;GrowVib x402 documentation&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What would you build first: a comparison assistant, a purchasing tool, or an order tracker?&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>tutorial</category>
      <category>blockchain</category>
      <category>x402</category>
    </item>
  </channel>
</rss>
