MaxaFi MaxaFi Merchant API v1

Merchant API

Connect your business systems to MaxaFi — sync customers, transactions, products, and more.

Base URL: https://www.maxafi.com/api/merchant/v1
1
Authenticate
X-Api-Key header
2
Validate
Data staged & checked
3
Mask
Sensitive fields protected
4
Respond
Scoped to your account

Authentication

Every request requires an API key in the X-Api-Key header. Keys start with mk_ followed by 48 hex characters.

# Example request
curl -H "X-Api-Key: mk_a1b2c3d4e5f6..." \
  https://www.maxafi.com/api/merchant/v1/customers
Important: Your API key is shown once when created. Save it immediately. If lost, create a new one.

To get an API key, ask your MaxaFi admin or use the AI agent:

"Create a sandbox API key for my account with read access to transactions and customers"

Environments

EnvironmentUse ForData
sandboxTesting & developmentSafe to experiment
productionLive integrationsReal merchant data

Start with sandbox. Switch to production once tested.

Rate Limits

LimitDefaultMax
Per minute601,000
Per day10,000100,000

Every response includes rate limit headers:

X-RateLimit-Limit: 60
X-RateLimit-Remaining: 47

Exceeding limits returns HTTP 429 with a Retry-After header.

Response Format

Success

{
  "success": true,
  "data": { ... },
  "meta": {
    "response_time_ms": 42,
    "api_version": "v1"
  }
}

Error

{
  "success": false,
  "error": "Customer not found"
}

Pagination

ParamDefaultDescription
page1Page number (1-based)
limit25Records per page (max 100)
sortvariesSort field name
orderDESCASC or DESC

Paginated responses include:

"pagination": { "page": 1, "limit": 25, "total": 142, "pages": 6 }

Idempotency

Prevent duplicate operations on POST/PUT by passing an X-Idempotency-Key header:

curl -X POST \
  -H "X-Api-Key: mk_..." \
  -H "X-Idempotency-Key: order-12345" \
  -H "Content-Type: application/json" \
  -d '{"business_name": "Acme Corp"}' \
  https://www.maxafi.com/api/merchant/v1/customers

Same key twice = second request returns original result, no duplicate created.

Customers

GET /customers read:customers

List customers with search and filtering.

ParamTypeDescription
searchstringSearch name, email, MID, or DBA
statusstringFilter by status
statestring2-letter state code
pageintPage number
limitintRecords per page (max 100)
curl -H "X-Api-Key: mk_..." \
  "https://www.maxafi.com/api/merchant/v1/customers?search=coffee&state=NY"
GET /customers/{id} read:customers

Get a single customer. Sensitive fields are automatically masked.

{
  "data": {
    "id": 456,
    "business_name": "Main Street Coffee",
    "email": "owner@mainst.coffee",
    "ssn": "***-**-5678",
    "bank_account": "****9012",
    "routing_number": "****4567"
  }
}
POST /customers write:customers

Create a customer. Data goes through staging → validation → promotion to live database.

FieldTypeDescription
business_namestringREQUIREDLegal business name
emailstringREQUIREDEmail (validated, duplicate-checked)
contact_firststringoptionalFirst name
contact_laststringoptionalLast name
phonestringoptionalPhone number
addressstringoptionalStreet address
citystringoptionalCity
statestringoptional2-letter state code
zipstringoptionalZIP code (5 or 9 digits)

Success (201):

{
  "data": { "staging_id": 1001, "status": "promoted", "promoted_id": 456 },
  "message": "Customer created successfully"
}

Validation error (422):

{
  "error": "Validation failed",
  "detail": "[{\"field\":\"email\",\"error\":\"Invalid email format\"}]"
}
PUT /customers/{id} write:customers

Update an existing customer. Partial updates supported — send only the fields you want to change.

Transactions

GET /transactions read:transactions

List transactions with date range and amount filters.

ParamTypeDescription
date_fromdatetimeStart date (ISO format)
date_todatetimeEnd date (ISO format)
statusstringcompleted, pending, refunded, etc.
amount_mindecimalMinimum amount
amount_maxdecimalMaximum amount
curl -H "X-Api-Key: mk_..." \
  "https://www.maxafi.com/api/merchant/v1/transactions?date_from=2026-01-01&status=completed"
GET /transactions/{id} read:transactions

Get a single transaction. Card numbers masked to last 4 digits.

Products

GET /products read:products

List products with search and stock filters.

ParamTypeDescription
searchstringSearch by name or SKU
categorystringFilter by category
in_stockbooleantrue = in stock only
POST /products write:products

Create a product via staging pipeline.

FieldTypeDescription
namestringREQUIREDProduct name
skustringoptionalSKU (used for upsert matching)
pricedecimalREQUIREDPrice
stock_qtyintoptionalStock quantity

Webhooks

POST /webhooks?platform={name} write:webhooks

Receive inbound webhooks from Shopify, QuickBooks, Square, or custom platforms. Data is automatically field-mapped and staged.

Webhook signatures are verified per platform:

  • Shopify: X-Shopify-Hmac-SHA256
  • Square: X-Square-Hmac-SHA256
  • QuickBooks: Intuit-Signature
  • Custom: X-Webhook-Signature

Integrations

GET /integrations manage:integrations

List all configured integrations with status and last sync info.

POST /integrations manage:integrations

Create a new integration. Returns webhook URL and secret for your platform.

FieldTypeDescription
platformstringREQUIREDshopify, quickbooks, square, woocommerce, stripe, custom
integration_namestringREQUIREDHuman-readable label
sync_directionstringoptionalinbound, outbound, bidirectional
sync_frequencystringoptionalrealtime, hourly, daily, manual
POST /integrations/sync manage:integrations

Trigger a manual sync. Pass integration_id in the body.

GET /integrations/platforms manage:integrations

List all supported platforms with capabilities.

GET /integrations/field-maps?platform=shopify manage:integrations

View field mapping templates. Optionally filter by entity_type (customer, transaction, product).

Staging Pipeline

All POST/PUT data goes through staging before reaching the live database. Review, retry, or reject records.

GET /staging read:staging

List staged records. Filter by status (pending, valid, invalid, promoted, rejected) and entity_type.

POST /staging/{id} read:staging

Manage a staged record: {"action": "retry"} to re-validate, or {"action": "reject"} to discard.

Audit Log

GET /audit read:audit

View your API call history with timing, status codes, and errors.

ParamTypeDescription
endpointstringFilter by path
methodstringGET, POST, PUT, DELETE
errors_onlybooleanShow only 400+ responses
date_fromdatetimeStart date
date_todatetimeEnd date

Usage & Rate Limits

GET /usage read:usage

Current rate limit status, 7-day usage trends, endpoint breakdown, and anomaly alerts.

Permission Scopes

Each API key has specific permissions. Requests outside your scope return 403 Forbidden.

read:transactions
List and view transactions
write:transactions
Create transactions via gateway
read:customers
List and view customers
write:customers
Create and update customers
read:products
List and view products
write:products
Create and update products
write:webhooks
Receive inbound webhooks
manage:integrations
Create, update, sync integrations
read:audit
View API call audit log
read:usage
View rate limits and alerts
read:staging
View & manage staging pipeline

Data Masking

Sensitive data is always protected. This is built into the API and cannot be overridden.

FieldMaskingExample Output
SSN / Social Security***-**-{last 4}***-**-5678
Bank Account****{last 4}****9012
Routing Number****{last 4}****4567
Card Number****-****-****-{last 4}****-****-****-3456
CVVHidden(not returned)
Passwords / SecretsHidden(not returned)

Shopify Integration

Connect with the AI agent — just say:

"I want to connect my Shopify store to sync customers and orders"

Or set up manually:

  1. Create integration via POST /integrations with platform: "shopify"
  2. Copy the returned webhook URL and secret
  3. In Shopify Admin → Settings → Notifications → Webhooks
  4. Add webhooks for: orders/create, orders/paid, customers/create, customers/update
  5. Paste MaxaFi URL, select JSON format

QuickBooks Integration

"Connect my QuickBooks to sync invoices and customers"
  1. Create integration with platform: "quickbooks"
  2. Go to developer.intuit.com
  3. Select your app → Webhooks
  4. Add the MaxaFi webhook URL
  5. Select entities: Customer, Invoice, Payment

Square Integration

"Connect my Square POS to sync payments and customers"
  1. Create integration with platform: "square"
  2. Go to developer.squareup.com
  3. Your app → Webhooks → Add subscription
  4. Select events: payment.completed, customer.created
  5. Copy the signature key into your MaxaFi integration config

Field Mapping

External platform data is automatically translated. Example: Shopify → MaxaFi customer mapping:

Shopify FieldMaxaFi FieldTransform
customer.first_nameContactFirst
customer.last_nameContactLast
customer.emailEmaillowercase
customer.phonePhonenormalize
customer.default_address.companyBusName
customer.default_address.province_codeStateuppercase
order.total_priceamountto_decimal
payment.amount_money.amountamountcents → dollars

View all mappings: GET /integrations/field-maps?platform=shopify

HTTP Status Codes

CodeMeaningAction
200SuccessRequest completed
201CreatedRecord created via staging
202AcceptedData staged for review
400Bad RequestCheck parameters
401UnauthorizedInvalid or missing API key
403ForbiddenMissing permission or IP blocked
404Not FoundResource doesn't exist
422Validation FailedCheck the detail field
429Rate LimitedWait for Retry-After seconds
500Server ErrorContact support

Quick Start

1. Get your API key

# In the AI chat, say:
"Create a sandbox API key with read access to transactions and customers"

# Save the key: mk_abc123...

2. List recent transactions

curl -H "X-Api-Key: mk_abc123..." \
  "https://www.maxafi.com/api/merchant/v1/transactions?limit=10"

3. Create a customer

curl -X POST \
  -H "X-Api-Key: mk_abc123..." \
  -H "Content-Type: application/json" \
  -d '{"business_name":"Main Street Coffee","email":"hello@mainst.coffee","state":"NY"}' \
  https://www.maxafi.com/api/merchant/v1/customers

4. Connect Shopify

# In the AI chat:
"Connect my Shopify store to sync orders and customers"

# The agent creates the integration and walks you through setup.

5. Check usage

curl -H "X-Api-Key: mk_abc123..." \
  "https://www.maxafi.com/api/merchant/v1/usage"