Private Checkout
What the payer's browser reads and calls without a key: one private payment, the network's confidential-token setup, and the confirmation of the two confidential transfers that pay it.
The same shape as GET /v1/zk-payments/config, built by the same code, for a page with no API key: the merchant's confidential-account page (register, balance, withdraw) and the checkout read the contracts they prove against here. Everything in it is public on-chain data. enabled is false, and the rest null, on a network where private payments do not run yet (mainnet today).
network*stringThe network to describe. Named by the caller, since a keyless page has no API key to take it from.
"testnet""public"OK
The body, query or path failed validation. message is an array of the individual failures.
Routes that reject a valid request for a reason of their own (an amount, a memo, a state) document the code for it on their own 400.
The budget in x-cosmos-rate-limit is spent for this caller. Honour Retry-After.
The ratelimit-* triple rides along on successful responses too, so a client can pace itself instead of being refused. If the counter store itself is unreachable the guard fails closed and answers 503 provider_unavailable.
Unexpected server error. The detail is logged server-side and never returned: there is nothing in the body to branch on beyond the code.
curl -X GET 'https://api.cosmospay.lat/cosmos-api/v1/zk-checkout/config?network=testnet'{ "enabled": true, "network": "testnet", "rpcUrl": "https://soroban-testnet.stellar.org", "networkPassphrase": "Test SDF Network ; September 2015", "token": { "contractId": "CBQU5SGVPPYI5MVBVV5GYTYNHENHBY7J44WYYVDPTZ5UNK6JDEY232QX", "symbol": "XLM", "decimals": 7, "underlying": "CDLZFC3SYJYDZT7K67VZ75HPJVIEUVNIXF47ZG2FB2RMQQVU2HHGCYSC", "deployedAtLedger": 5387137 }, "verifier": "CAN45PFA5CVUCU3JB77IE2JNWNTRCDWMRNG55U452L3N2IOCAGOLTUVQ", "auditorRegistry": "CDKWSGQER4KNDTMZS2W7V4E32KSL7BVM3LBY7EBTPWZZ3SFG5CDAOLF2", "auditorId": 0, "feeBps": 18, "feeAccount": "GDUYXOQZFVPDVIVBTJNUCGYQEC3XSI2LQOQ3SJWJJ6ZY4JLCJZZFGTNQ"}For a checkout: the gross amount, the net and the commission, the merchant and the fee account to transfer to, the token and the RPC to prove and submit with, and the live status to poll.
The id is the capability. Nothing about the owning merchant account, the idempotency key or the settling transactions is returned.
id*stringThe private payment id (a cuid), as the merchant shared it.
OK
network_unsupported: the payment's network or token is no longer served by this deployment.
No private payment has this id. The same answer the owner gets from GET /v1/zk-payments/{id} for one that never existed.
The budget in x-cosmos-rate-limit is spent for this caller. Honour Retry-After.
The ratelimit-* triple rides along on successful responses too, so a client can pace itself instead of being refused. If the counter store itself is unreachable the guard fails closed and answers 503 provider_unavailable.
Unexpected server error. The detail is logged server-side and never returned: there is nothing in the body to branch on beyond the code.
curl -X GET 'https://api.cosmospay.lat/cosmos-api/v1/zk-checkout/cmh4x2k9a0001l70g8v5q3z2w'{ "id": "cmh4x2k9a0001l70g8v5q3z2w", "status": "PENDING", "amount": "25.5", "netAmount": "25.49745", "feeAmount": "0.00255", "feeBps": 1, "recipient": "GCALNQQBXAPZ2WIRSDDBMSTAKCUH5SG6U76YBFLQLIXJTF7FE5AX7AOO", "feeAccount": "GDUYXOQZFVPDVIVBTJNUCGYQEC3XSI2LQOQ3SJWJJ6ZY4JLCJZZFGTNQ", "merchantFee": { "bps": 150, "fixed": "0.25", "amount": "1.75", "asset": "XLM", "wallet": "GBDHAQXQQ75WVBUZ2IX3O7ME7JOKJUOUPUXRNDCORUJODWQCTVUEQ62R", "paidBy": "recipient" }, "description": "Order #24", "expiresAt": "2026-10-25T15:00:00.000Z", "network": "testnet", "rpcUrl": "https://soroban-testnet.stellar.org", "networkPassphrase": "Test SDF Network ; September 2015", "token": { "contractId": "CBQU5SGVPPYI5MVBVV5GYTYNHENHBY7J44WYYVDPTZ5UNK6JDEY232QX", "symbol": "XLM", "decimals": 7, "underlying": "CDLZFC3SYJYDZT7K67VZ75HPJVIEUVNIXF47ZG2FB2RMQQVU2HHGCYSC", "deployedAtLedger": 5387137 }, "auditorId": 0}Reads both transactions back through the Soroban RPC and settles the payment only when: both succeeded and each is a single confidential_transfer on the token; both closed while the payment was open (not before it was created, not after expiresAt); both come from the same payer; the payment transfer goes to the recipient and the fee transfer to the fee account; and each decrypts with the auditor key, on both auditor channels and against the transfer's commitment, to exactly netAmount / feeAmount. Neither transaction may have settled another private payment.
Idempotent: the same hashes on a settled payment answer it again. A refusal leaves the payment PENDING, and never says what an amount decrypted to.
A payment with a merchantFee has a third transfer, of merchantFee.amount to merchantFee.wallet: send its hash as merchantFeeTxHash (required for such a payment, refused for any other). It is checked like the other two, in the same order.
id*stringThe private payment id (a cuid), as the merchant shared it.
application/json- body
The transactions of the confidential transfers that paid a private payment, to verify on-chain and settle it with.
paymentTxHash*stringThe transaction of the confidential transfer that paid the merchant the payment's netAmount (64 hex).
feeTxHash*stringThe transaction of the confidential transfer that paid the fee account the payment's feeAmount (64 hex), from the same account.
merchantFeeTxHash?stringOnly for a payment with a merchant fee, and then required: the transaction of the confidential transfer that paid merchantFee.wallet the payment's merchantFee.amount (64 hex), from the same account.
OK
transaction_not_found: the RPC has no such transaction yet (retry in a few seconds) or no longer. transaction_rejected: it failed on-chain. payment_transfer_mismatch / fee_transfer_mismatch / merchant_fee_transfer_mismatch: that transaction is not the confidential transfer this payment needs (wrong token, shape, recipient, amount, or it closed before the payment existed). payer_mismatch: the transfers come from different accounts. expired: a transfer closed after expiresAt. invalid_state_transition: already settled by other transactions. validation_failed also answers a merchantFeeTxHash missing on a payment with a merchant fee, or sent for one without.
No private payment has this id. The same answer the owner gets from GET /v1/zk-payments/{id} for one that never existed.
transaction_already_settled: one of the transactions already settled another private payment, of any merchant. One transaction settles at most one payment.
The budget in x-cosmos-rate-limit is spent for this caller. Honour Retry-After.
The ratelimit-* triple rides along on successful responses too, so a client can pace itself instead of being refused. If the counter store itself is unreachable the guard fails closed and answers 503 provider_unavailable.
Unexpected server error. The detail is logged server-side and never returned: there is nothing in the body to branch on beyond the code.
provider_unavailable: the provider in x-cosmos-upstream is down or unreachable; the message names it. Retry.
misconfigured: this deployment is missing configuration the route needs (a provider instance, a fee wallet, the plan header the gateway must forward). Retrying will not help; it is an operator problem.
curl -X POST 'https://api.cosmospay.lat/cosmos-api/v1/zk-checkout/cmh4x2k9a0001l70g8v5q3z2w/confirm' \ -H 'Content-Type: application/json' \ -d '{ "paymentTxHash": "0bd74f4b2725dc4f5b1c4ddabd7f66d66ac5a613c20f8175f2893eb33e757477", "feeTxHash": "5f0e8a1d3c7b9e2f4a6c8d0b1e3f5a7c9d2b4e6f8a0c1d3e5f7a9b2c4d6e8f0a"}'{ "id": "cmh4x2k9a0001l70g8v5q3z2w", "status": "PENDING", "amount": "25.5", "netAmount": "25.49745", "feeAmount": "0.00255", "feeBps": 1, "recipient": "GCALNQQBXAPZ2WIRSDDBMSTAKCUH5SG6U76YBFLQLIXJTF7FE5AX7AOO", "feeAccount": "GDUYXOQZFVPDVIVBTJNUCGYQEC3XSI2LQOQ3SJWJJ6ZY4JLCJZZFGTNQ", "merchantFee": { "bps": 150, "fixed": "0.25", "amount": "1.75", "asset": "XLM", "wallet": "GBDHAQXQQ75WVBUZ2IX3O7ME7JOKJUOUPUXRNDCORUJODWQCTVUEQ62R", "paidBy": "recipient" }, "description": "Order #24", "expiresAt": "2026-10-25T15:00:00.000Z", "network": "testnet", "rpcUrl": "https://soroban-testnet.stellar.org", "networkPassphrase": "Test SDF Network ; September 2015", "token": { "contractId": "CBQU5SGVPPYI5MVBVV5GYTYNHENHBY7J44WYYVDPTZ5UNK6JDEY232QX", "symbol": "XLM", "decimals": 7, "underlying": "CDLZFC3SYJYDZT7K67VZ75HPJVIEUVNIXF47ZG2FB2RMQQVU2HHGCYSC", "deployedAtLedger": 5387137 }, "auditorId": 0}Private Payments
Payments on Stellar whose amount stays hidden on-chain. Create a private payment, list and read them; the merchant receives the amount minus the private-payment commission (see https://cosmospay.lat/pricing).
Liquidity Pools
Deposit into and withdraw from Stellar AMM pools, and track your positions.