ndeipipayments APIv1 · 0.1.0-draftAPI reference

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

  1. 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 returns 422 price_risk_not_acknowledged. The time of the acknowledgement is recorded on the wallet.

  2. Lock a quote

    POST /quotes with 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 user amount_out before they confirm.

    Shell
    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" }'
  3. Convert

    Create a transfer between the two wallets with the quote_id. It settles at once and returns completed.

    Shell
    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 /quotes returns 503 provider_unavailable.