API · Commerce
Billing & subscriptions
Recurring revenue, one-shot invoices, products + prices, coupons, tax rates. The Stripe-equivalent commerce surface, scoped to Djibouti rails for collection.
12 endpointsprod_ · price_ · sub_
Products & prices
POST
/v1/productsCreate a product (the thing you sell).
GET
/v1/productsList products.
GET
/v1/products/{id}Retrieve a product.
POST
/v1/pricesAttach a price (one-time or recurring) to a product.
GET
/v1/pricesList prices (filter by product).
Invoices
POST
/v1/invoicesCreate an invoice (draft).
GET
/v1/invoicesList invoices (filter by customer, status).
POST
/v1/invoices/{id}/finalizeFinalise — locks the price list and sends the invoice (collection scheduled per subscription).
Subscriptions
POST
/v1/subscriptionsSubscribe a customer to one or more prices.
GET
/v1/subscriptionsList subscriptions.
DELETE
/v1/subscriptions/{id}Cancel — immediate or at period end (cancel_at_period_end flag).
Sample · monthly subscription
bashbash
# 1) Create the product
curl -X POST https://api.merashub.com/v1/products \
-H "Authorization: Bearer sk_test_..." \
-d '{ "name": "Pro plan", "description": "Pro tier monthly" }'
# 2) Attach a price (recurring monthly)
curl -X POST https://api.merashub.com/v1/prices \
-H "Authorization: Bearer sk_test_..." \
-d '{
"product": "prod_...",
"amount_minor": 250000,
"currency": "DJF",
"recurring": { "interval": "month", "interval_count": 1 }
}'
# 3) Subscribe a customer
curl -X POST https://api.merashub.com/v1/subscriptions \
-H "Authorization: Bearer sk_test_..." \
-d '{
"customer": "cus_...",
"items": [{ "price": "price_..." }],
"default_payment_method": "pm_..."
}'ℹ
Collection on Djibouti rails
Recurring charges use the customer's
default_payment_method — typically a tokenised mobile-money MSISDN. We try the same provider that the customer paid with on the first subscription invoice; if that provider can't auto-renew (some can't), the invoice is sent for customer confirmation via a hosted link.