PayByMy.AI
For developers

Custom & headless integration

You're running a custom backend, headless commerce stack, or your own storefront and you want AI agents to check out. Skip the plugins — Pay By AI is just three HTTPS calls: mint a token, let the agent pay it, handle a webhook. Every capability that WooCommerce/Shopify plugins use is here on the REST API, and the MCP endpoint is the same one AI agents connect to regardless of which platform sold them the token.

The three surfaces you'll touch

STEP 01

Mint payment tokens from your backend

When your checkout is ready to collect payment, your server calls POST https://www.paybymyai.com/api/payment_requests with the amount, description, and an opaque merchantMetadata blob (stash your order ID here). Back comes a token that lives on Pay By AI — anyone with it can pay the request.

STEP 02

Let AI agents pay tokens via MCP

The buyer's AI assistant (Claude, ChatGPT, custom) pays the token through our MCP endpoint at POST https://www.paybymyai.com/api/mcp. You don't run this — we do — but your docs should include the token in whatever hand-off you give the agent (URL, QR code, order-complete page, chat message). The agent's session enforces its spending limits before any charge.

STEP 03

Fulfil on a signed webhook

When Stripe confirms the charge, we POST a JSON payload to your configured webhookUrl with an HMAC-SHA256 signature in X-PayByAI-Signature. Verify the signature, look up your order via the merchantMetadata.order_id you attached at mint time, and release the goods.

Minimal Node example

Call Pay By AI from any backend that can make an HTTPS POST. Zero SDK required.

// Mint a token when your checkout is ready for payment.
const res = await fetch("https://www.paybymyai.com/api/payment_requests", {
  method: "POST",
  headers: {
    "Authorization": "Bearer " + process.env.PAYBYAI_API_KEY,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    amountCents: 1500,
    description: "Large pepperoni",
    merchantMetadata: { order_id: order.id, store: "joes-pizza" },
    expiresInSeconds: 900,
  }),
});
const { id: token } = await res.json();

// Show 'token' on the order-complete page — any AI agent with a
// user budget code can pay it at https://www.paybymyai.com/api/mcp (pay_payment_request).
// Your /webhook endpoint fires on payment_intent.succeeded.

Machine-readable summary

Every endpoint + MCP tool in a single file, per the llmstxt.org convention. Point an LLM or code-gen tool at it:

https://www.paybymyai.com/llms.txt

Related docs

Developer integration — REST + MCP for custom stacks — Pay By AI