Indian government-mandated integrations including TReDS (Trade Receivables Discounting System) for MSME invoice financing, GeM (Government e-Marketplace) for government procurement, and E-Invoicing with IRP for GST compliance.
The Regulatory Integrations module enables compliance with Indian government mandates for MSME procurement and trade finance. It covers three key integrations that are now mandatory for enterprises dealing with MSMEs and government entities.
TReDS enables MSMEs to get their invoices financed by uploading receivables on RBI-authorized platforms. Buyers accept invoices, and financiers bid to discount them, providing working capital to MSMEs.
TReDS Invoice Financing Flow
=============================
MSME Vendor Buyer (ProKure) TReDS Platform Financier
| | | |
|-------- Invoice PO ---------> | | |
| | | |
| |--- Upload Invoice to TReDS -----> | |
| | (After 3-way match) | |
| | | |
| | <-- Notify Acceptance Request --- | |
| | | |
| |--- Accept/Reject Invoice -------> | |
| | (Within 48 hours) | |
| | | |
| | | <-- Bid for Factoring ------ |
| | | (Discount rate) |
| | | |
| <-- Receive Early Payment (T+2) ----------------------------- Financier pays MSME ------------- |
| | | |
| | <-- Payment Due (T+45 days) ----- | |
| | | |
| |--- Pay Financier + Interest ----> |-------- Settlement -------> |
Buyer and seller registration details with TReDS platforms (RXIL, M1xchange, Invoicemart).
Indexes: (tenant_id, entity_type, platform), (gstin), (platform_entity_id)
Invoices uploaded to TReDS for factoring with buyer acceptance tracking.
Indexes: (tenant_id, upload_status), (invoice_id), (vendor_id, platform), (acceptance_deadline)
Factoring bids from financiers and accepted financing details.
Indexes: (treds_invoice_id), (financier_id), (bid_status, is_winning_bid)
Master list of financiers (banks/NBFCs) registered on TReDS platforms.
Indexes: (platform, financier_code), (is_active)
Settlement tracking for buyer payments to financiers.
Indexes: (tenant_id, settlement_status), (due_date), (financier_id)
GeM is the national procurement portal for government entities. Integration enables sellers to list products, participate in bids, and sync orders with ProKure for fulfillment tracking.
GeM Order Sync Flow
====================
GeM Portal ProKure Vendor System
| | |
|--- Webhook: New Catalog Request ----> | |
| |--- Create/Update Catalog ----------> |
| | (gem_catalogs) |
| <-- Catalog Published ---------------- | |
| | |
|--- Webhook: Bid Invitation ---------> | |
| |--- Create gem_bids Record ---------> |
| | |
| <-- Bid Submission ------------------- | |
| | |
|--- Webhook: Order Placed -----------> | |
| |--- Create gem_orders --------------> |
| |--- Create internal PO --------------> |
| | |
| |--- Sync Fulfillment Status --------> |
| <-- ASN/Delivery Update -------------- | |
| | |
| <-- Invoice Upload (e-Invoice) ------- | |
Seller registration details with GeM portal.
Indexes: (tenant_id), (gem_seller_id), (gstin)
Product catalogs listed on GeM with pricing and availability.
Indexes: (tenant_id, catalog_status), (gem_product_id), (material_id), (gem_category_id)
Bid participation in GeM tenders and auctions.
Indexes: (tenant_id, bid_status), (gem_bid_id), (bid_submission_deadline)
Orders received through GeM portal with fulfillment tracking.
Indexes: (tenant_id, order_status), (gem_order_id), (internal_po_id), (buyer_organization)
Line items for GeM orders.
Indexes: (gem_order_id), (material_id)
Mapping between GeM categories/products and internal master data.
Indexes: (tenant_id, mapping_type, gem_code), (internal_id)
E-Invoicing through Invoice Registration Portal (IRP) is mandatory for GST compliance. Each invoice receives a unique Invoice Reference Number (IRN) and QR code from the government portal.
E-Invoice Generation Flow
==========================
ProKure IRP (Invoice Registration Portal) GST Portal
| | |
|--- Generate Invoice JSON -----------------> | |
| (Schema: e-Invoice v1.1) | |
| | |
| |--- Validate JSON Structure ------> |
| |--- Validate GSTIN ----------------> |
| |--- Validate HSN Codes ------------> |
| | |
| <-- IRN + Signed QR + Ack No --------------- | |
| | |
|--- Store IRN in einvoice_irn_details ------> | |
|--- Update invoice with IRN, QR ------------- | |
| | |
|--- Print Invoice with QR Code -------------- | |
| | |
| |--- Auto-populate GSTR-1 --------> |
Company registration with E-Invoice IRP for API access.
Indexes: (tenant_id), (gstin), (company_id)
E-Invoice submission attempts with status tracking.
Indexes: (tenant_id, submission_status), (invoice_id), (irn), (supplier_gstin, invoice_date)
Successfully generated IRN details with QR code and signed invoice.
Indexes: (irn), (invoice_id), (tenant_id, is_cancelled)
E-Invoice cancellation requests and approvals.
Indexes: (tenant_id, cancellation_status), (irn), (irn_detail_id)
Note: E-Invoice cancellation only allowed within 24 hours of generation
MongoDB collections for API interaction logs and audit trails. Used for debugging, compliance reporting, and analytics.
All TReDS API interactions including uploads, acceptances, and settlements.
GeM catalog sync, bid submissions, and order webhook logs.
E-Invoice IRP API calls for IRN generation and cancellation.
RESTful API endpoints for regulatory integrations.
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/treds/registrations | List TReDS registrations |
| POST | /api/treds/invoices/upload | Upload invoice to TReDS |
| POST | /api/treds/invoices/{id}/accept | Accept invoice for factoring |
| POST | /api/treds/invoices/{id}/reject | Reject invoice |
| GET | /api/treds/factoring-requests/{invoiceId} | Get factoring bids |
| GET | /api/treds/settlements | List pending settlements |
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/gem/catalogs | List GeM catalogs |
| POST | /api/gem/catalogs | Create/publish catalog item |
| GET | /api/gem/bids | List bid invitations |
| POST | /api/gem/bids/{id}/submit | Submit bid response |
| GET | /api/gem/orders | List GeM orders |
| POST | /api/gem/orders/{id}/accept | Accept order |
| PUT | /api/gem/orders/{id}/fulfillment | Update fulfillment status |
| POST | /api/gem/webhooks | GeM webhook receiver |
| Method | Endpoint | Description |
|---|---|---|
| POST | /api/einvoice/generate | Generate IRN for invoice |
| GET | /api/einvoice/{invoiceId} | Get IRN details |
| GET | /api/einvoice/irn/{irn} | Lookup by IRN |
| POST | /api/einvoice/{irn}/cancel | Request IRN cancellation |
| GET | /api/einvoice/pending | List invoices pending IRN |
| POST | /api/einvoice/bulk-generate | Bulk IRN generation |
Scheduled jobs for regulatory integration processing.
| Job | Schedule | Action |
|---|---|---|
| TReDS Invoice Upload | Every 15 mins | Upload matched invoices to TReDS |
| TReDS Acceptance Check | Every hour | Check acceptance status, auto-accept if 48h passed |
| TReDS Settlement Reminder | Daily (9 AM) | Alert for upcoming settlements |
| GeM Catalog Sync | Every 6 hours | Sync catalog prices and availability |
| GeM Bid Monitor | Every 30 mins | Check for new bid invitations |
| GeM Order Sync | Every 15 mins | Sync order status updates |
| E-Invoice Batch Generate | Every 5 mins | Generate IRN for pending invoices |
| E-Invoice Retry Failed | Every 30 mins | Retry failed IRN generations |
| E-Invoice Token Refresh | Every 30 mins | Refresh IRP auth tokens before expiry |
| Compliance Report | Monthly (1st) | Generate MSME compliance report |