Developer Documentation

WM Tech Solutions REST API

Integrate AI return analysis, fraud scoring, ticket summarization, and analytics into any custom stack. Base URL: https://api.wmtechsolutions.online/v1

Authentication

All API requests require a Bearer token in the Authorization header. Generate your API key from the WM Tech dashboard under Settings → API Keys. Keys are scoped per store and per permission level.

// All requests require this header
Authorization: Bearer wmtech_live_xxxxxxxxxxxxxxxxxxxxxxxx
Content-Type: application/json

Key types

Key PrefixEnvironmentDescription
wmtech_live_ProductionFull access. Triggers real refunds and fraud holds.
wmtech_test_SandboxNo real actions. All responses are simulated. Safe for development.

Error Codes

All errors return a JSON object with a code and message field.

HTTP StatusCodeMeaning
400invalid_requestMissing or malformed request parameters.
401unauthorizedInvalid or missing API key.
403forbiddenYour plan does not include this endpoint.
404not_foundOrder ID, store ID, or resource not found.
429rate_limitedToo many requests. Retry after the Retry-After header value.
500server_errorUnexpected error. Contact support with your request ID.

Rate Limits

Starter: 60 requests/min. Growth: 300 requests/min. Enterprise: Custom — negotiated per contract. Rate limit status is included in every response header: X-RateLimit-Remaining and X-RateLimit-Reset.

SDKs & Libraries

Official SDKs available for Node.js, Python, and PHP. Community SDKs for Ruby and Go maintained on GitHub.

# Install Node.js SDK
npm install wmtech-sdk

# Install Python SDK
pip install wmtech

# Install PHP SDK (Composer)
composer require wmtech/sdk

POST /returns/analyze

POSThttps://api.wmtechsolutions.online/v1/returns/analyze

Submit a return request with an attached photo URL for AI analysis. The model checks product identity, visible condition, and policy compliance. Returns a decision, reason, and refund amount if approved.

Request Parameters

ParameterTypeDescription
order_idstringYour platform order ID. Required.
store_idstringYour WM Tech store identifier. Required.
photo_urlstringPublic HTTPS URL to the return photo. JPEG or PNG, max 8MB. Required.
reasonstringCustomer's stated reason for the return. Optional but improves accuracy.
skustringProduct SKU for catalog cross-reference. Optional.

Response

{
"request_id": "req_2HgJk9pXmN",
"decision": "approved",
"confidence": 0.96,
"reason": "Manufacturing defect confirmed on rear left seam",
"refund_amount": 64.00,
"currency": "USD",
"policy_rule_matched": "manufacturing_defect_full_refund",
"processing_ms": 3820
}

POST /fraud/score

POSThttps://api.wmtechsolutions.online/v1/fraud/score

Submit a order for real-time fraud risk scoring before dispatch. Returns a 0–100 risk score, detected signals, and a recommended action based on your configured threshold.

Request Parameters

ParameterTypeDescription
order_idstringPlatform order ID. Required.
store_idstringWM Tech store identifier. Required.
customer_phonestringE.164 format phone number. Required for phone reuse signals.
shipping_addressobjectFull address object. Required for address velocity signals.
order_valuenumberOrder total in your currency. Required.
order_time_utcstringISO 8601 UTC timestamp of order placement. Optional.

Response

{
"request_id": "req_9TpLm4aQzW",
"risk_score": 91,
"recommendation": "hold",
"threshold_used": 75,
"signals": [
{ "signal": "address_velocity", "score_contribution": 38 },
{ "signal": "card_linked_chargebacks", "score_contribution": 28 },
{ "signal": "billing_shipping_mismatch", "score_contribution": 14 }
],
"processing_ms": 140
}

POST /tickets/summarize

POSThttps://api.wmtechsolutions.online/v1/tickets/summarize

Submit a multi-message support thread for AI summarization. Returns a 3-line summary, sentiment score, urgency level, and a suggested action for your support agent.

Request Parameters

ParameterTypeDescription
threadarrayArray of message objects: [{role, content, timestamp}]. Required.
store_idstringWM Tech store identifier. Required.
languagestringISO 639-1 language code. Auto-detected if omitted.

Response

{
"summary": "Order #5521 stuck at dispatch for 8 days. Tracking not updating. Customer has contacted support twice and has a time-sensitive event deadline.",
"sentiment_score": 8,
"urgency": "high",
"category": "shipping_delay",
"contact_count": 2,
"suggested_action": "Initiate carrier trace and offer express reship or full refund.",
"processing_ms": 98
}

Webhooks

WM Tech fires outbound webhooks to your configured endpoint URL on every AI action. Register webhook URLs in the dashboard under Settings → Webhooks. All payloads are signed with HMAC-SHA256 using your webhook secret.

Available Events

EventTriggered When
return.approvedReturn photo approved by AI, refund issued.
return.rejectedReturn rejected by AI, reason code attached.
fraud.flaggedorder risk score exceeds your threshold.
ticket.resolvedSupport ticket fully handled by AI.
ticket.escalatedTicket outside AI confidence routed to human agent.