> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.mitu.ai/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.mitu.ai/_mcp/server.

# Accept your first payment

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.

#### 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`**

```bash title="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.

#### 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`**

```json title="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"
  }
}
```

| URL            | When to use it                                                            |
| -------------- | ------------------------------------------------------------------------- |
| `url.checkout` | Use this URL when a human will complete the payment through checkout.     |
| `url.agent`    | Use 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.

#### 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.

| Event               | What it means                                    |
| ------------------- | ------------------------------------------------ |
| `link.created`      | The payment link was created.                    |
| `link.viewed`       | A human opened the checkout page.                |
| `payment.completed` | The payment was completed successfully.          |
| `payment.failed`    | A 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.

#### 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](/platform/payments/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.

#### [Configure webhooks](/guides/quick-start/configure-webhooks)

Configure your application to receive and process payment events.

#### [Create payment experiences](/guides/integration-guides/create-payment-experiences)

Learn how to create one-time payments, payment links, invoices and subscriptions.