API Reference

Affiliates

Manage referral codes and follow each affiliate's commissions.

Paying commissions out is not done through the API: in the panel it takes the refunds permission and a two-factor confirmation, which a token cannot give.

List affiliates

GET/api/v1/affiliatesAbilityaffiliates.read
Returns the store's affiliates with each one's commission totals.

Query parameters

codestring
The exact affiliate code.
is_activeboolean
1 for active ones only, 0 for inactive ones only.
per_pageinteger
Items per page, from 1 to 100. Default 20. A value outside that range returns 422.
pageinteger
Page number, from 1 to 10000. Default 1. A value outside that range returns 422.
curl "https://sellitex.com/api/v1/affiliates" \
  -H "Authorization: Bearer sk_live_..." \
  -H "Accept: application/json"
Response200
{
  "data": [
    {
      "id": 4,
      "name": "Canal do Fulano",
      "email": "[email protected]",
      "code": "FULANO",
      "commission_type": "percentage",
      "commission_value": 15,
      "is_active": true,
      "clicks_count": 1840,
      "conversions_count": 37,
      "commissions": {
        "pending": 2245,
        "confirmed_unpaid": 8150,
        "paid_out": 31900,
        "owed_back": 0
      },
      "created_at": "2026-07-02T10:00:00+00:00"
    }
  ],
  "links": {
    "first": "…?page=1",
    "last": "…?page=1",
    "prev": null,
    "next": null
  },
  "meta": {
    "current_page": 1,
    "from": 1,
    "last_page": 1,
    "per_page": 20,
    "to": 1,
    "total": 1
  }
}

Retrieve an affiliate

GET/api/v1/affiliates/{affiliate}Abilityaffiliates.read
A record that belongs to another store answers 404, exactly like one that doesn't exist.

Path parameters

affiliateintegerrequired
The affiliate id.
curl "https://sellitex.com/api/v1/affiliates/4" \
  -H "Authorization: Bearer sk_live_..." \
  -H "Accept: application/json"
Response200
{
  "data": {
    "id": 4,
    "name": "Canal do Fulano",
    "email": "[email protected]",
    "code": "FULANO",
    "commission_type": "percentage",
    "commission_value": 15,
    "is_active": true,
    "clicks_count": 1840,
    "conversions_count": 37,
    "commissions": {
      "pending": 2245,
      "confirmed_unpaid": 8150,
      "paid_out": 31900,
      "owed_back": 0
    },
    "created_at": "2026-07-02T10:00:00+00:00"
  }
}

Create an affiliate

POST/api/v1/affiliatesAbilityaffiliates.write
Creates an affiliate under the same rules as the panel. The code is stored in uppercase, is what goes in ?ref= on the link and must be unique in the store. Without is_active, it starts active.

Request body (JSON)

namestringrequired
Name, up to 120 characters.
emailstring
Contact e-mail.
codestringrequired
The referral code, up to 40 characters.
commission_typestringrequired
percentage or fixed.
commission_valueintegerrequired
Percentage (1 to 100) or fixed amount in cents per sale, depending on the type.
is_activeboolean
Whether new referrals count.
curl -X POST "https://sellitex.com/api/v1/affiliates" \
  -H "Authorization: Bearer sk_live_..." \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{"name":"Canal do Fulano","email":"[email protected]","code":"FULANO","commission_type":"percentage","commission_value":15}'
Response201
{
  "data": {
    "id": 4,
    "name": "Canal do Fulano",
    "email": "[email protected]",
    "code": "FULANO",
    "commission_type": "percentage",
    "commission_value": 15,
    "is_active": true,
    "clicks_count": 1840,
    "conversions_count": 37,
    "commissions": {
      "pending": 2245,
      "confirmed_unpaid": 8150,
      "paid_out": 31900,
      "owed_back": 0
    },
    "created_at": "2026-07-02T10:00:00+00:00"
  }
}

Update an affiliate

PUT/api/v1/affiliates/{affiliate}Abilityaffiliates.write
Replaces the affiliate's settings: send every field, as on creation. Without is_active, its current state is kept. Commissions already recorded do not change.

Path parameters

affiliateintegerrequired
The affiliate id.

Request body (JSON)

namestringrequired
Name, up to 120 characters.
emailstring
Contact e-mail.
codestringrequired
The referral code, up to 40 characters.
commission_typestringrequired
percentage or fixed.
commission_valueintegerrequired
Percentage (1 to 100) or fixed amount in cents per sale, depending on the type.
is_activeboolean
Whether new referrals count.
curl -X PUT "https://sellitex.com/api/v1/affiliates/4" \
  -H "Authorization: Bearer sk_live_..." \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{"name":"Canal do Fulano","email":"[email protected]","code":"FULANO","commission_type":"percentage","commission_value":20}'
Response200
{
  "data": {
    "id": 4,
    "name": "Canal do Fulano",
    "email": "[email protected]",
    "code": "FULANO",
    "commission_type": "percentage",
    "commission_value": 20,
    "is_active": true,
    "clicks_count": 1840,
    "conversions_count": 37,
    "commissions": {
      "pending": 2245,
      "confirmed_unpaid": 8150,
      "paid_out": 31900,
      "owed_back": 0
    },
    "created_at": "2026-07-02T10:00:00+00:00"
  }
}

Delete an affiliate

DELETE/api/v1/affiliates/{affiliate}Abilityaffiliates.write
Deletes an affiliate that never referred a sale. One with sales keeps the history of its commissions — deactivate it with is_active: false.

Path parameters

affiliateintegerrequired
The affiliate id.

Possible refusals

affiliate_has_conversions409
The affiliate has already referred orders.
curl -X DELETE "https://sellitex.com/api/v1/affiliates/4" \
  -H "Authorization: Bearer sk_live_..." \
  -H "Accept: application/json"
Response204
(no body)

The object

The fields this resource's endpoints return. Money is an integer in cents and dates are ISO 8601, in UTC.

idinteger
The affiliate identifier.
namestring
Name.
emailstring|null
Contact e-mail, when there is one.
codestring
The referral code.
commission_typestring
percentage or fixed.
commission_valueinteger
Percentage or fixed amount in cents.
is_activeboolean
Whether new referrals count.
clicks_countinteger
Visits that arrived through the affiliate's link.
conversions_countinteger
Orders referred.
commissionsobject
Totals in cents: pending (order not paid yet), confirmed_unpaid (to pay), paid_out (already paid) and owed_back (paid on orders refunded since, netted against the next payout).
created_atstring
When it was created.