Affiliates
Create Affiliate
Learn how to create an affiliate using the POST /stores//affiliates endpoint.
POST
Create affiliate
π Endpoint
POST /stores/{storeId}/affiliates
Creates a new affiliate in the store.
The code (slug) is used to build the promotion link:
https://YOUR_DOMAIN.com.br/l/{code}.
π Authentication
- Private route.
- Requires the
Authorizationheader with your API key and an active plan.
π§Ύ Route parameters
π€ Body (JSON)
β Request example
π¦ Success response (201)
β οΈ Possible errors
400 INVALID_DATAβ invalid body400 INVALID_DATA_NAMEβnamemissing or outside 1 to 56 characters400 INVALID_DATA_EMAILβemailmissing, invalid, or longer than 120 characters400 INVALID_DATA_CODEβcodemissing, outside 3 to 50 characters, or invalid slug format400 INVALID_DATA_IMAGEβ invalidimage(invalidhttp/httpsURL or longer than 512 characters)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 found409 AFFILIATE_ALREADY_EXISTSβcodealready exists409 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
Body
application/json
Affiliate details (name, email, code, commissionRules).