# Introduction (https://dev.cosmospay.lat/docs/)

> Accept stablecoin payments from every network Cosmos Pay works with, and swap between them, with the Cosmos Pay SDK and the Payments REST API.

**Cosmos Pay** lets you accept payments that customers pay from any network we work with (payment
intents with SEP-7, Solana Pay and EIP-681 links, and a swap in first when the funds are on another
network), swap on one network or between them, and manage webhooks, products, customers and analytics. These docs cover both ways to integrate:

- [SDK · Overview](https://dev.cosmospay.lat/docs/sdk/server/overview/): What @cosmosapp/pay_sdk is, the server + browser entry points, and the mental model.
- [SDK · Quickstart](https://dev.cosmospay.lat/docs/sdk/server/quickstart/): The smallest end-to-end flow: create an intent, complete it in the wallet, validate it.
- [API Reference](https://dev.cosmospay.lat/docs/api/): The Payments REST API (OpenAPI): payment intents, webhooks, products, customers, analytics.
- [Webhooks](https://dev.cosmospay.lat/docs/sdk/server/webhooks/): Register endpoints, receive events, and verify signatures.

## The payment flow

A payment has three steps (shown here with the SDK, on Stellar):

1. **Server** creates an intent with your secret API key (`client.paymentIntents.createPay`/`createTx`).
2. **Browser** completes it with the user's Stellar wallet (`new WebClient().pay(intent)`), producing an on-chain `txHash`.
3. **Server** validates that hash (`intent.validate(txHash)`), which updates the status and fires a webhook.

The network is chosen by the API key type: `dv_` keys hit **testnet**, `prod_` keys hit **mainnet**.

On Solana and Monad, pass `chain`, with the SDK (`createPay({ chain: 'solana', ... })`, from version 2.2) or the [REST API](https://dev.cosmospay.lat/docs/api/payment-intents/):
you get a Solana Pay or EIP-681 link, the payer pays it from any wallet on that chain, and the
Payments API detects the payment on-chain and fires the same webhooks.
