Developer
POST /affiliates

Create an affiliate

Affiliates

Description

Create a new affiliate business.

Authentication Required: User must be authenticated and have the 'affiliate' role.

The affiliate is created with a pending_validation status by default.

Request Body

required

application/json

Responses

201 Affiliate created successfully
application/json
statusstring
Example: success
messagestring
Example: Affiliate created successfully
dataobject
401 Authentication required
application/json
Example:
{
  "status": "error",
  "message": "Not authenticated or insufficient permissions"
}
403 Insufficient permissions
application/json
Example:
{
  "status": "error",
  "message": "Feature affiliate required"
}
422 Validation error
application/json
Example:
{
  "status": "error",
  "message": "Failed to create affiliate",
  "errors": [
    {
      "path": "name",
      "message": "Name can't be blank"
    }
  ]
}