Affiliates
Update Affiliate
Learn how to update an affiliate using the PUT /stores//affiliates/ endpoint.
PUT
Update affiliate
π Endpoint
PUT /stores/{storeId}/affiliates/{affiliateId}
Updates an affiliateβs data (name, email, code, image, status, metadata, and commission rules).
All fields are optional β only the sent fields are changed.
π Authentication
- Private route.
- Requires the
Authorizationheader with your API key and an active plan.
π§Ύ Route parameters
π€ Body (JSON)
β Request example
π¦ Success response (200)
β οΈ Possible errors
400 INVALID_DATAβ invalid body400 INVALID_DATA_NAMEβnameoutside 1 to 56 characters400 INVALID_DATA_EMAILβ invalidemailor longer than 120 characters400 INVALID_DATA_IMAGEβ invalidimage(invalidhttp/httpsURL or longer than 512 characters)400 INVALID_DATA_CODEβcodeoutside 3 to 50 characters or invalid slug format400 INVALID_DATA_STATUSβ invalidstatus(must beativoorinativo)400 INVALID_DATA_METADATAβ invalidmetadata(not an object or exceeds 64 keys)400 INVALID_DATA_RULESβ invalidcommissionRules(not an array)400 INVALID_COMMISSION_RULESβ emptycommissionRules400 INVALID_COMMISSION_RULE_TYPEβ invalidtype400 INVALID_COMMISSION_RULE_POSITIONβ invalid/duplicatedposition400 INVALID_COMMISSION_VALUEβcommissionoutside 1 to 100400 COMMISSION_RULE_DEFAULT_REQUIREDβ exactly oneDEFAULTrule is required400 INVALID_COMMISSION_RULE_TARGETβDEFAULTwithtargetId, orPRODUCT/CATEGORY/COUPONwithouttargetId400 RELATION_NOT_FOUNDβ product/category/coupontargetIddoes not exist in the store401 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β affiliate not found409 AFFILIATE_ALREADY_EXISTSβcodealready used by another affiliate409 AFFILIATE_EMAIL_ALREADY_EXISTSβ email already registered by another affiliate in the store429 RATE_LIMIT_EXCEEDEDβ per-minute rate limit exceeded500 INTERNAL_SERVER_ERRORβ internal server error503 SERVICE_UNAVAILABLEβ service unavailable
Path Parameters
Body
application/json
Affiliate fields to update.