Skip to navigation

Accept your first payment

Create a payment that can be completed by a human or an AI agent.
View as Markdown

Mitu payment links let you create a payment that can be completed by either a human or an AI agent. You create the payment once and receive separate payment URLs for each type of payer.

Both payment flows represent the same payment, which means you can use the same reference to track the payment in your system regardless of how it is completed.

1

Create a payment

Create a one-time payment and include a reference that identifies the corresponding order, purchase or transaction in your own system.

Request
curl --request POST \
--url https://api.mitu.ai/v1/payment-links \
--header "x-api-key: $MITU_API_KEY" \
--header "Content-Type: application/json" \
--data '{
"type": "charge",
"amount": 25.00,
"currency": "USD",
"description": "Invoice 8841",
"reference": "ORDER-8841",
"paymentMethods": ["x402", "mpp_spt"]
}'

The reference should contain an identifier that your application already understands. When payment activity is reported, you can use this value to associate the payment with the corresponding record in your system.

The paymentMethods field determines which supported payment methods an AI agent can use to complete the payment.

2

Use the payment URLs

The payment provides separate URLs for humans and AI agents. Both URLs belong to the same payment and use the same amount, currency and reference.

Payment URLs
{
"payment_link_id": "pay_n8d7piu1yc6h",
"amount": "25.00",
"currency": "USD",
"reference": "ORDER-8841",
"url": {
"checkout": "https://mitu.ai/pay/pay_n8d7piu1yc6h",
"agent": "https://api.mitu.ai/pay/pay_n8d7piu1yc6h"
}
}
URLWhen to use it
url.checkoutUse this URL when a human will complete the payment through checkout.
url.agentUse this URL when an AI agent will complete the payment programmatically.

You do not need to choose the type of payer when you create the payment. You can provide the appropriate URL depending on how the customer is completing the transaction.

Agent payments

The agent URL returns the payment requirements that an AI agent needs to complete the payment. Mitu handles the supported agent payment protocols and confirms the payment before reporting it as completed.

3

Confirm the payment

Use payment events to determine when the payment has been completed. A payment.completed event confirms that the payment was successful.

The event includes the reference you provided when creating the payment. Use this reference to find the corresponding order or transaction in your system and update its payment status.

EventWhat it means
link.createdThe payment link was created.
link.viewedA human opened the checkout page.
payment.completedThe payment was completed successfully.
payment.failedA payment attempt did not complete successfully.

The link.viewed event applies to the human checkout experience and should not be used to determine whether an AI agent has started a payment.

Confirm payments from a trusted source

Do not mark an order as paid based on a browser redirect or information returned by an AI client. Use a verified payment.completed webhook or retrieve the payment status from the API before updating your system.

4

Receive your funds

Funds from completed payments are added to your Mitu balance. The way the payment was completed does not change how the funds are made available to your business.

You can settle your available balance to a supported bank account or withdraw stablecoins to an onchain address.

Learn more about Settlement.

Continue building

Configure webhooks so your application can receive payment events automatically, or continue to the payment experiences guide to build other payment flows.