Developers

Merchant API · v1

FINEXA Developer Docs

Base URL: https://finexaemi.online/wp-json/finexa/v1. All amounts are integers in paise (INR).

Get sandbox keys

1. Authentication

Create keys in your merchant dashboard. Send them as Authorization: Bearer <key_id>.<secret>. Keys starting fxk_test_ are sandbox and fxk_live_ are live. Every POST /purchases/authorise needs an Idempotency-Key header. The rate limit is 120 requests per minute per key. Never expose your secret in browser code.

2. Endpoints

MethodEndpointPurpose
GET/emi-preview?amount=Public EMI plans for a price (no key needed). Use it for product-page badges.
POST/eligibility/check{amount, customer_ref} → eligible yes/no and maximum tenure. Never reveals the customer’s limit.
POST/purchases/authoriseCreates a purchase. Live returns redirect_url, where the customer confirms on FINEXA.
GET/purchases · /purchases/{id}List, or get one purchase’s status.
POST/purchases/{id}/captureOn shipment. Starts the customer’s EMI loan and queues your settlement.
POST/purchases/{id}/cancelBefore capture. Releases the hold on the customer’s limit.
POST/purchases/{id}/refund{amount, reason}, full or partial. Reduces the customer’s loan automatically.
GET/settlements/reconciliation?date=Daily captures, refunds and net.
GET/audit-logsYour account’s activity log.
GET/healthService status.

Status flow: pending_customer_confirmation → authorised → captured → partially_refunded / refunded. A purchase can also end as declined, cancelled, or expired (if not confirmed within 30 minutes).

3. Checkout flow

curl -X POST $BASE/purchases/authorise \ -H “Authorization: Bearer fxk_live_xxx.fxs_yyy” \ -H “Idempotency-Key: order-1001-1” -H “Content-Type: application/json” \ -d ‘{“merchant_order_id”:”1001″,”amount”:2499900, “customer_ref”:”buyer@email.com”, “return_url”:”https://shop.example/finexa/return?order=1001″}’ → 201 {“id”:”pur_…”,”status”:”pending_customer_confirmation”, “redirect_url”:”https://…/checkout/?purchase=pur_…”, “environment”:”live”} # Send the shopper to redirect_url. They sign in, choose an EMI plan, # accept the Key Fact Statement and return to: # return_url?finexa_purchase=pur_…&status=authorised # Always verify with GET /purchases/{id} or the webhook before fulfilling.

4. Webhooks

Set your HTTPS endpoint in the dashboard. Each event is sent as {id, type, environment, data} with the header X-Finexa-Signature: t=<unix>,v1=<hex HMAC-SHA256(secret, t + "." + body)>. Reject any event older than 5 minutes.

Events: purchase.authorised, purchase.declined, purchase.captured, purchase.cancelled, purchase.refunded.

5. Drop-in JavaScript

<script src=”https://finexaemi.online/wp-content/plugins/finexa-core/assets/finexa-checkout.js” data-finexa-base=”https://finexaemi.online/wp-json/finexa/v1″></script> <div data-finexa-emi=”2499900″></div> <!– “or ₹4,4xx/month with FINEXA” –> <script> FinexaCheckout.open(redirectUrlFromYourServer); </script>

6. WooCommerce

Ask your partnerships manager for the FINEXA for WooCommerce plugin. Upload it, then paste your API base URL, API key and webhook secret under WooCommerce → Payments → FINEXA EMI. Payments are captured when an order is completed, released when it’s cancelled, and refunds go through automatically.

Sandbox

Purchases up to the sandbox maximum are authorised instantly. Use customer_ref: "cus_test_decline" to test a decline. Sandbox never creates real loans or settlements.