Skip to main content

Merchants API

List Merchants

GET /api/merchants

Create Merchant

POST /api/merchants
{
  "name": "Acme Corp",
  "legalName": "Acme Corporation LLC",
  "email": "billing@acme.com",
  "phone": "+1 555-0100",
  "website": "https://acme.com",
  "industry": "Technology"
}

Get Merchant

GET /api/merchants/:id

Update Merchant

PATCH /api/merchants/:id

Delete Merchant

DELETE /api/merchants/:id
{
  "retention": "immediate"
}
Retention options: immediate (delete now), 30days, 90days (soft delete with cleanup).

NMI Credentials

Test Connection

POST /api/nmi/test-connection
{
  "apiKey": "your_private_key",
  "gatewayUrl": "https://secure.nmi.com"
}
Validates the API key and returns the merchant profile from NMI.

Save Credentials

POST /api/nmi/credentials
{
  "merchantId": "clx...",
  "name": "Production Gateway",
  "apiKey": "your_private_key",
  "tokenizationKey": "your_tokenization_key",
  "gatewayUrl": "https://secure.nmi.com"
}
API keys are encrypted with AES-256-GCM before storage.

Trigger Sync

POST /api/nmi/sync
{
  "nmiAccountId": "clx..."
}