> ## Documentation Index
> Fetch the complete documentation index at: https://docs.lynq.am/llms.txt
> Use this file to discover all available pages before exploring further.

# Payment Intents

> Create and retrieve payments safely from your server.

# Payment Intents

A Payment Intent represents one attempt to collect payment for an order. Create it on your server, then return its `id` and `clientSecret` only to the browser session that is about to display Checkout.

```bash theme={null}
curl --request POST "https://api.lynq.am/api/payment-intents" \
  --header "Authorization: Bearer sk_test_..." \
  --header "Content-Type: application/json" \
  --header "Idempotency-Key: order:order_123" \
  --data '{"amount":2500000,"currency":"AMD","orderId":"order_123"}'
```

| Field      | Required | Description                                   |
| ---------- | -------- | --------------------------------------------- |
| `amount`   | Yes      | Positive integer in minor currency units.     |
| `currency` | Yes      | `AMD`, `USD`, `EUR`, or `RUB`.                |
| `orderId`  | Yes      | Your order identifier, up to 32 characters.   |
| `customer` | No       | Your customer ID and optional name and email. |
| `metadata` | No       | String key-value data for reconciliation.     |

## Idempotency

Send `Idempotency-Key` on every create request. Reuse the key only when retrying the same order and identical request body. This prevents duplicate Payment Intents after a timeout.

## Retrieve a Payment Intent

```bash theme={null}
curl --request GET "https://api.lynq.am/api/payment-intents/pi_..." \
  --header "Authorization: Bearer sk_test_..."
```

<Warning>
  Do not call Checkout's browser-facing endpoints directly. The hosted Checkout SDK manages its own confirmation flow.
</Warning>


## Related topics

- [API reference](/reference/api.md)
- [Card payments](/payment-methods/card.md)
- [Test your integration](/go-live/testing.md)
- [Lynq overview](/index.md)
- [Quickstart](/start/quickstart.md)
