Installation
Initialization
Initialize the client with your Merchant credentials.Core Methods
Create Setup Session
Generates a URL where your user can authorize a spending mandate.Charge Mandate
Executes a payment using anintentMandate (SD-JWT-VC) provided by an agent.
Check Balance
Query the remaining monthly limit for a specific mandate.Fetch (x402 Auto-Payment)
A drop-in replacement for the nativefetch API that automatically intercepts and handles x402 (HTTP 402 Payment Required) challenges.
If the requested endpoint returns a 402 status with X-PAYMENT requirements, the SDK will:
- Verify the price is within the agent’s pre-authorized spending mandate.
- Sign the required transaction automatically under the hood (zero popups).
- Append the signed
X-Paymentheader and seamlessly retry the request.