When to create one
Create a Payment Intent when the customer starts the payment step. Use one Payment Intent for one checkout attempt.- If your application retries the same create request because of a timeout, reuse its idempotency key.
- If the customer starts a genuinely new payment attempt, create a new Payment Intent.
- Do not reuse a succeeded, canceled, or otherwise unavailable Payment Intent.
Create a Payment Intent
clientSecret. That raw client secret is returned when the Payment Intent is created; pass it directly to the browser session that will mount Checkout.
Amounts and currencies
amount is an integer in the currency’s minor units. Lynq supports AMD, USD, EUR, and RUB; each currently uses two minor-unit digits.
Calculate the final amount on your server after discounts, delivery, and tax. Do not accept a browser-supplied total without checking it against the order.
Order, customer, and metadata
- Use
orderIdfor the merchant order identifier you will search for during reconciliation. - Use
customer.idfor your internal customer identifier.emailandnameare optional. - Use
metadatafor string values useful to your systems, such as a cart, store, or invoice identifier.
Idempotency
SendIdempotency-Key on every create request. A stable key such as order:order_123:attempt:1 makes a retry return the original result instead of creating another Payment Intent.
The same idempotency key must not be reused with a different request body. Create a new key when the amount, currency, order, customer, metadata, or actual payment attempt changes.
Handle the client secret
The client secret authorizes Checkout for this Payment Intent. It is less privileged than your secret API key but still needs careful handling:- Return it only to the customer session paying the corresponding order.
- Send it over HTTPS.
- Do not persist it in browser storage, analytics, error reports, or URLs.
- Create a fresh Payment Intent when the session is no longer usable.