📝 Intents
Intents represent payment requests in AgentTech. This section covers all intent-related API methods.
CreateIntent
Creates a new payment intent. Returns an intent ID that you'll use for subsequent operations.
Request Parameters
Amount Rules
- Minimum: 0.02 USDC
- Maximum: 1,000,000 USDC
- Precision: Up to 6 decimal places (e.g.
"0.000001","123.45")
Example
const intent = await client.createIntent({
email: "merchant@example.com",
amount: "100.50",
payerChain: "base"
});
resp, err := client.CreateIntent(ctx, &pay.CreateIntentRequest{
Email: "merchant@example.com",
Amount: "100.50",
PayerChain: "base",
})
ExecuteIntent
Executes an intent using the Agent wallet. The backend signs and transfers USDC on Base automatically.
Requires authentication (Bearer token).
Example
const result = await client.executeIntent(intentId);
exec, err := client.ExecuteIntent(ctx, resp.IntentID)
// exec.Status is typically "BASE_SETTLED"
SubmitProof
Submits a settlement proof after the payer completes X402 payment on the source chain.
No authentication required (public endpoint).
Example
const proof = await client.submitProof(intentId, settleProof);
proof, err := client.SubmitProof(ctx, intentID, settleProof)
GetIntent
Queries the current status of an intent. Use this to poll for status updates.
Example
const intent = await client.getIntent(intentId);
switch (intent.status) {
case "BASE_SETTLED":
// Payment complete
break;
case "EXPIRED":
case "VERIFICATION_FAILED":
case "PARTIAL_SETTLEMENT":
// Terminal failure
break;
default:
// Still processing - poll again
}
intent, err := client.GetIntent(ctx, intentID)
switch intent.Status {
case pay.StatusBaseSettled:
// use intent.BasePayment for receipt
case pay.StatusExpired, pay.StatusVerificationFailed, pay.StatusPartialSettlement:
// terminal failure
default:
// still processing — poll again
}
Intent Expiration
Intents expire 10 minutes after creation. If not executed within this window, the intent status becomes EXPIRED (terminal state).