Guides
Convert to NdeipiCoin
NdeipiCoin is optional and its price moves. Users buy and sell it only by converting points, at a price you lock first.
The flow
- Create the coin wallet
Show the user that NdeipiCoin's value can fall, then create a wallet with
"asset": "ndeipi-coin"and"acknowledge_price_risk": true. Without it the request returns422 price_risk_not_acknowledged. The time of the acknowledgement is recorded on the wallet. - Lock a quote
POST /quoteswith the source wallet, the same user's destination wallet and the amount. The quote holds its rate for about 30 seconds (expires_at) and shows Ndeipi's spread as a fee. Show the useramount_outbefore they confirm.curl -X POST "$NDEIPI/quotes" \ -H "Api-Key: $NDEIPI_API_KEY" -H "Idempotency-Key: $(uuidgen)" \ -H "Content-Type: application/json" \ -d '{ "source_wallet_id": "wal_01JA8Z4K2V9QW3H6Y7XKD2M0RS", "destination_wallet_id": "wal_01JA8Z9X1Y2Z3A4B5C6D7E8F9G", "amount": "50.00" }' - Convert
Create a transfer between the two wallets with the
quote_id. It settles at once and returnscompleted.curl -X POST "$NDEIPI/transfers" \ -H "Api-Key: $NDEIPI_API_KEY" -H "Idempotency-Key: $(uuidgen)" \ -H "Content-Type: application/json" \ -d '{ "source": { "type": "wallet", "wallet_id": "wal_01JA8Z4K2V9QW3H6Y7XKD2M0RS" }, "destination": { "type": "wallet", "wallet_id": "wal_01JA8Z9X1Y2Z3A4B5C6D7E8F9G" }, "amount": "50.00", "quote_id": "qt_01JA8ZJ6XS3V8E1C9B6A5Z4Y3X" }'
Rules
- Only purchased points can buy NdeipiCoin; earned points return
422 amount_exceeds_cashable. - Points from selling NdeipiCoin are cashable.
- NdeipiCoin can't be paid out directly: convert it to points first, then pay out.
- A quote can be used once (
409 quote_used) and only before it expires (422 quote_expired). Its wallets and amount must match the transfer (422 quote_mismatch). - Very large conversions can return
422 insufficient_liquidity. Try a smaller amount later. - If NdeipiCoin has no current price,
POST /quotesreturns503 provider_unavailable.