Authentication and the first request
The API base URL is https://api.weprofit.com/v1/dev. Create a personal access token in the Developer page’s API tokens card. Send it in the Authorization header as a Bearer token. Keep the token in your server environment, not storefront JavaScript or a public repository.
The token follows its owner’s store permissions. Staff need developer access and the relevant analytics or events permission. Revoked or expired tokens are rejected.
curl https://api.weprofit.com/v1/dev/stores \
-H "Authorization: Bearer $WEPROFIT_API_TOKEN"Choose a store from the response
Use an ID returned by the stores endpoint for subsequent requests. The following values are illustrative and contain no customer data.
{
"items": [{
"id": "STORE_ID",
"name": "Example store",
"platform": "shopify",
"currency": "USD",
"timezone": "America/New_York",
"role": "owner"
}]
}Reporting endpoints
All paths below are relative to the API base and require bearer authentication. Replace :storeId with an accessible active store ID. The table covers reporting reads. The REST API also supports ad-spend updates and webhook subscription management; it is not an entirely read-only API.
| Method and path | Purpose | Optional query parameters |
|---|---|---|
| GET /me | User identity and non-secret token metadata | None |
| GET /stores | Accessible active stores and their IDs | None |
| GET /stores/:storeId/summary | Visitors, sessions, purchases, revenue, coverage and profit summary | from, to |
| GET /stores/:storeId/orders | Orders, attribution and per-network delivery status | from, to, limit, cursor and order filters |
| GET /stores/:storeId/events | Normalized events, source, channel, consent state and value | from, to, limit, cursor and event filters |
| GET /stores/:storeId/profit | Revenue, refunds, product costs, fees, shipping, spend and net profit | from, to |
| GET /stores/:storeId/profit/timeseries | Daily profit and cost series | from, to |
| GET /stores/:storeId/profit/ad-spend | Spend by day, network and campaign | month, formatted YYYY-MM |
Dates, filters and pagination
Provide from and to as inclusive UTC dates in YYYY-MM-DD format. If omitted, the reporting range defaults to today and the preceding six days. Set both dates explicitly for repeatable comparisons. The ad-spend endpoint instead uses month and defaults to the current UTC month.
Order and event lists default to 50 rows and accept up to 200. Results are newest first. Pass the returned nextCursor unchanged to fetch another page. Data can change during pagination, so this does not provide a frozen snapshot.
- Order filters include order_id, status, financial_status, tracked, link_method, link_confidence, channel, currency, min_total, max_total and sent_to.
- Event filters include event_name, event_id, source, channel, country, url_contains, consent_state, currency, min_value and max_value.
- Both lists support visitor_id and session_id. Event filters also support checkout_token and cart_token.
curl "https://api.weprofit.com/v1/dev/stores/STORE_ID/profit?from=2026-09-01&to=2026-09-07" \
-H "Authorization: Bearer $WEPROFIT_API_TOKEN"Read several stores in one request
GET /summary, /orders, /events, /profit and /profit/timeseries accept a required stores query containing up to 50 comma-separated store IDs. Supply the same date and filter options as the corresponding single-store request.
Batch responses contain results with independent success or error entries for each store. A denied store does not invalidate the others. Summary, order and event successes place their payload under data; profit successes expose their profit fields alongside storeId and ok. Each store’s order or event result has its own nextCursor.
Interpret profit fields correctly
Profit reports use recorded and estimated cost inputs. Cancelled orders are excluded from the profit calculation and reported separately. The margin is null when net revenue is zero.
Timeseries returns days with order or ad-spend activity, not a zero-filled calendar. Its netProfit includes refunds even though each timeseries item does not expose a separate refunds field. Use the aggregate profit endpoint when you need the explicit refund total.
Rate limits and common errors
Current limits are 240 requests per minute and 20,000 requests per day per token. Reduce request frequency and use bounded retries when rate limited. Avoid retrying invalid credentials or permissions without correcting the cause.
| HTTP status | Meaning | Next action |
|---|---|---|
| 400 validation_error | Invalid dates, filters or other query input | Correct the request parameters. |
| 401 unauthorized | Missing, revoked or expired token | Use an active token and the Bearer header. |
| 402 plan_required | The store does not have the required billing entitlement | Review store billing and any over-cap restriction. |
| 403 forbidden | Insufficient permission | Ask the owner to review the token user’s access. |
| 404 store_not_found | Store unavailable to this request | Use an accessible active ID from GET /stores. |
| 429 rate_limited | Token request limit reached | Back off and reduce request volume. |