Merchant Page Editing
Complete guide to editing merchants directly on the merchant detail page.
Overview
The merchant detail page (/admin/merchants/{merchantId}) is now the primary interface for viewing and editing merchant information. The edit modal has been removed, and all editing happens inline on the merchant page.
Accessing the Merchant Page
From Merchants Table
- Click Company Name: Click on any merchant's company name in the merchants table
- Actions Menu: Click the "⋯" (three dots) button → "✏️ Edit"
From Other Pages
- Stripe Page: Click on linked merchant name to navigate to merchant page
- Direct URL: Navigate to
/admin/merchants/{merchantId}(e.g.,/admin/merchants/M000101)
Merchant Page Structure
The merchant page displays information in cards:
- Merchant Information - ID, company name, company number, domain, CreditSafe link
- Stripe Billing - Customer ID, name, email, phone, address, billing status (with Link/Unlink button)
- Contact Information - Contact type, name, email, phone
- Lender Configuration - Enabled lenders and credit products
- App Settings - Environment, snippet code, deployment status, features
Inline Editing
Enabling Edit Mode
- Navigate to the merchant page
- Click the "Edit Merchant" button at the bottom
- Fields in the Merchant Information card become editable
- Button changes to "Save Changes"
- A "Cancel" button appears
Editing Fields
When in edit mode, the following fields become editable:
- Company Name - Text input
- Domain - URL input (automatically adds
https://if missing) - Company Number - Text input (optional)
Note: Merchant ID can be edited. Changes are validated and processed via the merchant ID change flow.
Saving Changes
- Make your edits
- Click "Save Changes"
- Changes are validated and saved to the API
- Page refreshes with updated data
- Edit mode exits automatically
Canceling Edits
- Click "Cancel" button
- All changes are discarded
- Page reverts to read-only view
- Original data is restored
Stripe Billing Management
Link/Unlink Button
The Stripe Billing card has a Link/Unlink button in the header:
- "Link" - Shows when no Stripe customer is linked
- "Unlink" - Shows when a Stripe customer is already linked (green background)
Linking a Stripe Customer
- Click "Link" button in Stripe Billing card header
- Modal opens showing all Stripe customers
- Search by Customer ID, Name, or Email
- View customer details:
- Customer ID
- Name
- Subscription Plan
- Current FinMatch Merchant (if linked)
- Click "Link" button next to desired customer
- Connection is saved to
merchants.json - Page refreshes showing linked customer
Unlinking a Stripe Customer
- Click "Unlink" button in Stripe Billing card header
- Confirm the action
- Connection is removed from
merchants.json - Page refreshes showing "Not linked" status
Universal Card Editing Layer
The merchant page uses a universal editing layer that can be extended to other cards:
Current Support
- ✅ Merchant Information card - Full inline editing
- ⏳ Stripe Billing card - Link/Unlink functionality
- ✅ Contact Information card - Inline editing (saved through Contacts API sync)
- ⏳ Lender Configuration card - Coming soon
- ✅ App Settings card - Environment integrity check + snippet checks
Future Expansion
Each card can independently enable edit mode, allowing granular control over what can be edited.
Navigation
Side Navigation
The side navigation works correctly on merchant detail pages:
- Dashboard →
../../ - Merchants →
../../merchants/ - Stripe →
../../stripe/ - Lenders →
../../lenders/ - Analytics →
../../analytics/ - Documentation →
../../docs/
Navigation automatically detects merchant detail pages and adjusts paths accordingly.
Breadcrumb
The breadcrumb shows:
- Merchants →
{Merchant Name}
Clicking "Merchants" returns to the merchants table.
API Integration
Update Merchant
Endpoint: PUT /api/merchants/{merchantId}
Request Body:
{
"merchantName": "Updated Company Name",
"companyName": "Updated Company Name",
"domain": "https://updated-domain.com",
"companyNo": "12345678"
}
Response: Updated merchant object
Link Stripe Customer
Endpoint: PUT /api/merchants/{merchantId}/stripe-connection
Request Body:
{
"stripeCustomerId": "cus_xxxxx"
}
Response: Updated merchant object with Stripe connection
Unlink Stripe Customer
Endpoint: DELETE /api/merchants/{merchantId}/stripe-connection
Response: Updated merchant object without Stripe connection
Best Practices
- Always Save: Click "Save Changes" after editing, or "Cancel" to discard
- Validate Domain: Domain is automatically normalized (adds
https://if missing) - Check Stripe Status: Verify Stripe customer is correctly linked before saving
- Use Search: Use search in Stripe linking modal to find customers quickly
- Review Changes: Page refreshes after save - verify changes are correct
Troubleshooting
Edit Mode Not Working
Check:
- Merchant page is loaded (
window.currentMerchantDetailsexists) - JavaScript console for errors
- Network tab for API call failures
Stripe Link Not Working
Check:
- Stripe customers are loaded (
stripeCustomersarray exists) - API endpoint is accessible
- Merchant ID is correct
Navigation Links Broken
Check:
- URL path includes merchant ID (e.g.,
/admin/merchants/M000101) nav-builder.jsis loaded- Navigation uses
../../for merchant detail pages
Related Documentation
- Editing Merchants - Legacy edit modal documentation (deprecated)
- Merchant Snippet Integration - Snippet code details
- Developer Field Mapping - Backend field mapping