ndeipipayments APIv1 · 0.1.0-draftAPI reference

Essentials

Amounts and assets

Decimal strings

Amounts are decimal strings, such as "25.00", in requests and responses. Never send a JSON number: binary floating point can't represent most money amounts exactly.

  • Each asset and currency has a number of decimal places, published by GET /routes. Ndeipi Points carry 2 and NdeipiCoin carries 8. An amount with more places is refused with 422 invalid_amount_precision; the API never rounds an amount you sent.
  • Amounts the API calculates, such as fees and converted amounts, are rounded half-even. Points bought with fiat and fiat paid out are rounded down, so the cash held always covers the points that can be cashed out.

Codes

  • Currencies are lower-case ISO 4217 codes: zar, usd.
  • Countries are ISO 3166-1 alpha-2 codes: ZW, ZA.
  • Phone numbers are E.164: +263771234567.

Assets

AssetWhat it is
ndeipi-pointsNdeipi Points. Bought with fiat at a fixed price per currency and cashed out the same way. Every user's default asset.
ndeipi-coinNdeipiCoin. Optional, and its price moves. Bought and sold only by converting points.

Read the price of points in a currency with GET /rates. For points it's fixed: Ndeipi sets one price per currency and changes it only by announcement.

Purchased and earned points

A points wallet shows one balance but keeps two kinds of points apart:

  • Purchased points were bought with fiat and can be cashed out.
  • Earned points come from rewards. They can be spent and sent, never cashed out.

Spending and sending use earned points first, and a recipient receives points of the same kind, so a reward never becomes cash by changing hands. The wallet balance's cashable field is how much can be paid out; an off-ramp above it returns 422 amount_exceeds_cashable.