← Back to site

Quick-start

Provision sandbox credentials, create a merchant agent, and trigger your first 402 payment flow. This is a living document and will expand into a full developer portal.

  1. Request sandbox access using the form on the landing page. We will send an API key pair and webhook secret. Rotate keys through the CLI utility once published.
  2. Install the SDK once available: npm install @forgingblock/402-gateway. For now, use raw HTTP requests against the REST interface described below.
  3. Create a merchant agent. Authenticate with your sandbox key and call:
    curl -X POST https://sandbox.ai.forgingblock.io/v1/agents   -H "Authorization: Bearer <SANDBOX_KEY>"   -H "Content-Type: application/json"   -d '{"name":"orders-bot","callback_url":"https://yourservice/webhooks/402"}'
  4. Request payment by issuing a 402 challenge:
    curl -X POST https://sandbox.ai.forgingblock.io/v1/payments   -H "Authorization: Bearer <SANDBOX_KEY>"   -H "Content-Type: application/json"   -d '{"amount":"9.99","currency":"USD","to":"orders-bot","metadata":{"order_id":"TBD"}}'
  5. Verify webhooks. Expect deterministic callbacks delivered in order. Validate the X-402-Signatureheader using the shared secret.

Need more detail? Email hello@forgingblock.io or jump onto the 402 ecosystem Slack.