Affiliates
Get Affiliates
Learn how to search affiliates and display complete information using GET /stores//affiliates.
GET
List affiliates
📌 Endpoint
GET /stores/{storeId}/affiliates
Searches and filters the store’s affiliates. With statistics=true, the response includes the statistics (net revenue — already net of gateway fees, sales and clicks calculated on the fly) and the period metrics (from/to).
⚙️ How the commission is resolved
At sale time, the percentage is resolved per item:- Among the affiliate’s
commissionRules, the ones that match the item are considered:PRODUCT→ the item is the product (targetId);CATEGORY→ the item belongs to the category (targetId);COUPON→ the coupon applied to the payment is (targetId);DEFAULT→ always matches any item.
- The rule with the lowest
positionamong the matches wins. - If no other rule matches, the
DEFAULT(highestposition) is the affiliate’s default percentage.
targetIdvalidation happens at POST/PUT: forPRODUCT,CATEGORYandCOUPONit must exist in the store. Rules whosetargetwas removed later are ignored during resolution, without affecting the sale.
🔐 Authentication
- Private route.
- Requires the
Authorizationheader with your API key and an active plan.
🔎 Query params
🔄 Cursor pagination
For large lists (more than ~100 items), prefer cursor pagination instead ofpage:
- Make the first call without
cursor. - If
hasMoreistrue, the response includes thenextCursorfield. - Send that
nextCursorin thecursorparameter of the next request to fetch the next page.
nextCursor, hasMore and limit:
cursorandpagecannot be used together (400 INVALID_PAGINATION).nextCursor: nullwithhasMore: falseindicate the end of the list (the API responds200with an empty array).
✅ Request example — list with filters
✅ Request example — full information about an affiliate
📦 Success response (200)
The first call (withoutcursor) already returnsnextCursorandhasMorein the pagination, allowing cursor pagination to start without extra calls.
⚠️ Possible errors
400 INVALID_DATA→ invalid parameters (id,name, invalidemailor longer than 120 characters,code,status,from,to, orstoreId)400 INVALID_PAGINATION_LIMIT→limitoutside the allowed range (1to100)400 INVALID_PAGINATION_PAGE→ invalidpage400 INVALID_PAGINATION_CURSOR→ invalid or malformedcursor400 INVALID_PAGINATION→pageandcursorused together401 API_KEY_NOT_PROVIDED→Authorizationheader not provided401 INVALID_API_KEY→ invalid API key401 UNAUTHENTICATED→ unauthenticated user403 USER_DISABLED→ user disabled403 NO_ACTIVE_SUBSCRIPTION→ no active plan404 STORE_NOT_FOUND→ store not found404 AFFILIATE_NOT_FOUND→ informedidnot found (applies only in offset mode, withoutcursor)429 RATE_LIMIT_EXCEEDED→ per-minute rate limit exceeded500 INTERNAL_SERVER_ERROR→ internal server error503 SERVICE_UNAVAILABLE→ service unavailable