Skip to main content
POST
/
stores
/
{storeId}
/
affiliates
/
{customerId}
Create a new affiliate for a customer.
curl --request POST \
  --url https://api.komerza.com/stores/{storeId}/affiliates/{customerId} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "link": "<string>",
  "isEnabled": true,
  "returnPercentage": 50,
  "percentageOff": 50,
  "balance": 8.988465674311579e+307
}
'
{
  "success": true,
  "message": "<string>",
  "code": "<string>",
  "data": {
    "isEnabled": true,
    "balance": 8.988465674311579e+307,
    "link": "<string>",
    "returnPercentage": 50,
    "percentageOff": 50
  }
}

Authorizations

Authorization
string
header
required

Your API key goes here

Path Parameters

storeId
string<uuid>
required

Store to create the affiliate in.

customerId
string<uuid>
required

Target customer ID.

Body

application/json

Affiliate details (link, percentages, etc.).

Form for creating or updating a store‐affiliate record.

A link provided to affiliates for tracking and promotional purposes. Required and must not exceed 256 characters.

Maximum string length: 256
isEnabled
boolean | null

Indicates whether the affiliate is active. If null, defaults to true when creating, or leaves unchanged when updating.

returnPercentage
integer<int32> | null

The percentage of the order return the affiliate receives. If null, uses store’s default when creating, or leaves unchanged when updating.

Required range: 0 <= x <= 100
percentageOff
integer<int32> | null

The percentage discount offered by the affiliate link. If null, uses store’s default when creating, or leaves unchanged when updating.

Required range: 0 <= x <= 100
balance
number<double> | null

The affiliate’s current balance. If null, defaults to zero when creating, or leaves unchanged when updating.

Required range: 0 <= x <= 1.7976931348623157e+308

Response

The object was successfully created.

Represents a default generic response for API endpoints.

success
boolean
required

Indicates whether the operation or response was successful.

message
string | null

A descriptive message providing additional context or information about the response.

code
string | null

The error code (if there was an error) to use when referencing the error

data
object

Form for store owners to edit affiliate status.