> Source: https://developers.terrawallet.us/docs/reference/payment-intents . Terra Wallet developer docs (early access).

<!-- GENERATED by apps/mcp/scripts/build-docs-index.mjs. Do not edit by hand. -->

# Payment intents

> **Preview.** Generated from `docs/developers/openapi-v1.json` (the exported OpenAPI document, authoritative) and, for operations it does not contain yet, from the v1 build contract (`docs/platform/V1_CONTRACT.md`). Each contract-only operation is marked.

One payment for one amount. Terra quotes an exact crypto amount per accepted asset, the customer pays from their own wallet to yours, and the intent succeeds only on verified chain data.

**Authentication:** Secret key or dashboard session.

**Guide:** [Payment intents](https://developers.terrawallet.us/docs/pay/payment-intents.md)

| Method | Path | Summary |
|---|---|---|
| POST | `/v1/payment_intents` | Create a payment intent and its hosted checkout URL. |

## POST /v1/payment_intents

Create a payment intent and its hosted checkout URL.

- Operation id: `createPaymentIntent`
- Authentication: Secret key or dashboard session
- `Idempotency-Key`: required
- Source: the v1 contract. This operation is not in the OpenAPI document yet.

### Request body

| Name | Type | Required | Notes |
|---|---|---|---|
| `amount` | string (decimal) | yes | A decimal string such as "10.50", never a float. |
| `currency` | string | yes | A fiat ISO code: USD, EUR, INR and so on. |
| `accepted_assets` | array of asset | yes | Assets the customer may pay with. An asset is {chain, symbol, contract (null for a native coin), decimals}. |
| `description` | string | no | Plain text. |
| `metadata` | object | no | Up to 20 keys; string values up to 500 characters. |
| `expires_in_s` | integer | no | 300 to 86400. Default 900. |
| `success_url` | string (url) | no |  |
| `cancel_url` | string (url) | no |  |
| `customer_email` | string (email) | no |  |

### Response

The payment intent. status is one of requires_payment, processing, succeeded, expired, canceled, underpaid, overpaid.

```json
{
  "id": "pi_...",
  "status": "requires_payment",
  "checkout_url": "https://pay.terrawallet.us/c/pi_...",
  "amount": "10.50",
  "currency": "USD",
  "quotes": [
    {
      "asset": {
        "chain": "tron",
        "symbol": "USDT",
        "contract": "TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t",
        "decimals": 6
      },
      "amount_base_units": "...",
      "pay_address": "...",
      "expires_at": "..."
    }
  ]
}
```

### Notes

- Verification: an exact unique amount per intent, a confirmation policy per chain, one transaction per intent, chain truth only.
- Amounts on chain are integer base units in strings, with the asset's decimals alongside.
