Introduction

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:

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

On this page