# Affiliate

## Register partner

> Registers the user as a partner in the affiliate program.

```json
{"openapi":"3.0.0","info":{"title":"Web API v2 - Public ","version":"1.0.0"},"tags":[{"name":"Affiliate"}],"servers":[{"url":"https://eu1.make.com/api/v2","description":"EU1 production zone"},{"url":"https://eu2.make.com/api/v2","description":"EU2 production zone"},{"url":"https://us1.make.com/api/v2","description":"US1 production zone"},{"url":"https://us2.make.com/api/v2","description":"US2 production zone"},{"url":"https://eu1.make.celonis.com/api/v2","description":"Celonis EU1 production zone"},{"url":"https://us1.make.celonis.com/api/v2","description":"Celonis US1 production zone"}],"security":[{"token":["user:write"]}],"components":{"securitySchemes":{"token":{"type":"apiKey","name":"Authorization","in":"header","description":"Authorize the API call with your API token in the `Authorization` header with the value: `Token your-api-token`.\n\nIf you don't have an API token yet, please refer to the [\"Authentication\" section](/api-documentation/authentication) to learn how to create one.\n"}}},"paths":{"/affiliate/partner-register":{"post":{"tags":["Affiliate"],"summary":"Register partner","description":"Registers the user as a partner in the affiliate program.","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"partnerCode":{"type":"string"},"paypalMeLink":{"type":"string"},"termsAndConditions":{"type":"boolean"}},"required":["partnerCode","paypalMeLink","termsAndConditions"]}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"integer"}}}}}}}}}}}
```

## Get commission stats

> Retrieves graph data for commisions in the past year for the current user.

```json
{"openapi":"3.0.0","info":{"title":"Web API v2 - Public ","version":"1.0.0"},"tags":[{"name":"Affiliate"}],"servers":[{"url":"https://eu1.make.com/api/v2","description":"EU1 production zone"},{"url":"https://eu2.make.com/api/v2","description":"EU2 production zone"},{"url":"https://us1.make.com/api/v2","description":"US1 production zone"},{"url":"https://us2.make.com/api/v2","description":"US2 production zone"},{"url":"https://eu1.make.celonis.com/api/v2","description":"Celonis EU1 production zone"},{"url":"https://us1.make.celonis.com/api/v2","description":"Celonis US1 production zone"}],"security":[{"token":["user:read"]}],"components":{"securitySchemes":{"token":{"type":"apiKey","name":"Authorization","in":"header","description":"Authorize the API call with your API token in the `Authorization` header with the value: `Token your-api-token`.\n\nIf you don't have an API token yet, please refer to the [\"Authentication\" section](/api-documentation/authentication) to learn how to create one.\n"}}},"paths":{"/affiliate/stats":{"get":{"tags":["Affiliate"],"summary":"Get commission stats","description":"Retrieves graph data for commisions in the past year for the current user.","parameters":[{"name":"dateFrom","in":"query","schema":{"type":"string","format":"date"}},{"name":"dateTo","in":"query","schema":{"type":"string","format":"date"}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"stats":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string","format":"date"},"visits":{"type":"integer"},"registrations":{"type":"integer"},"commission":{"type":"number"}}}}}}}}}}}}}}
```

## Get commissions

> Retrieves detailed data about individual commisions of the current user.

```json
{"openapi":"3.0.0","info":{"title":"Web API v2 - Public ","version":"1.0.0"},"tags":[{"name":"Affiliate"}],"servers":[{"url":"https://eu1.make.com/api/v2","description":"EU1 production zone"},{"url":"https://eu2.make.com/api/v2","description":"EU2 production zone"},{"url":"https://us1.make.com/api/v2","description":"US1 production zone"},{"url":"https://us2.make.com/api/v2","description":"US2 production zone"},{"url":"https://eu1.make.celonis.com/api/v2","description":"Celonis EU1 production zone"},{"url":"https://us1.make.celonis.com/api/v2","description":"Celonis US1 production zone"}],"security":[{"token":["user:read"]}],"components":{"securitySchemes":{"token":{"type":"apiKey","name":"Authorization","in":"header","description":"Authorize the API call with your API token in the `Authorization` header with the value: `Token your-api-token`.\n\nIf you don't have an API token yet, please refer to the [\"Authentication\" section](/api-documentation/authentication) to learn how to create one.\n"}}},"paths":{"/affiliate/commissions":{"get":{"tags":["Affiliate"],"summary":"Get commissions","description":"Retrieves detailed data about individual commisions of the current user.","parameters":[{"name":"statusId","in":"query","schema":{"type":"integer"}},{"name":"dateFrom","in":"query","schema":{"type":"string","format":"date"}},{"name":"dateTo","in":"query","schema":{"type":"string","format":"date"}},{"name":"pg[sortBy]","in":"query","schema":{"type":"string"},"description":"The value that will be used to sort returned entities by."},{"name":"pg[offset]","in":"query","schema":{"type":"integer"},"description":"The value of entities you want to skip before getting entities you need."},{"name":"pg[sortDir]","in":"query","schema":{"type":"string","enum":["asc","desc"]},"description":"The sorting order. It accepts the ascending and descending direction specifiers."},{"name":"pg[limit]","in":"query","schema":{"type":"integer"},"description":"Sets the maximum number of results per page in the API call response. For example, `pg[limit]=100`. The default number varies with different API endpoints."}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"commisions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"organization_id":{"type":"integer"},"created":{"type":"string","format":"date-time"},"type":{"type":"string"},"status":{"type":"string"},"commission":{"type":"number"},"source":{"type":"string"},"payout_requested":{"type":"string","format":"date-time"},"payout_approved":{"type":"string","format":"date-time"},"payout_realized":{"type":"string","format":"date-time"}}}}}}}}}}}}}}
```

## Get commission info

> Retrieves general info about accumulated commissions of the current user.

```json
{"openapi":"3.0.0","info":{"title":"Web API v2 - Public ","version":"1.0.0"},"tags":[{"name":"Affiliate"}],"servers":[{"url":"https://eu1.make.com/api/v2","description":"EU1 production zone"},{"url":"https://eu2.make.com/api/v2","description":"EU2 production zone"},{"url":"https://us1.make.com/api/v2","description":"US1 production zone"},{"url":"https://us2.make.com/api/v2","description":"US2 production zone"},{"url":"https://eu1.make.celonis.com/api/v2","description":"Celonis EU1 production zone"},{"url":"https://us1.make.celonis.com/api/v2","description":"Celonis US1 production zone"}],"security":[{"token":["user:read"]}],"components":{"securitySchemes":{"token":{"type":"apiKey","name":"Authorization","in":"header","description":"Authorize the API call with your API token in the `Authorization` header with the value: `Token your-api-token`.\n\nIf you don't have an API token yet, please refer to the [\"Authentication\" section](/api-documentation/authentication) to learn how to create one.\n"}}},"paths":{"/affiliate/commission-info":{"get":{"tags":["Affiliate"],"summary":"Get commission info","description":"Retrieves general info about accumulated commissions of the current user.","parameters":[{"name":"dateFrom","in":"query","schema":{"type":"string","format":"date"}},{"name":"dateTo","in":"query","schema":{"type":"string","format":"date"}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"partnerCode":{"type":"string"},"availablePayout":{"type":"number"},"availablePayoutDistinctOrgs":{"type":"integer"},"isPayoutRequested":{"type":"boolean"},"isPayoutAvailable":{"type":"boolean"},"minimumPayout":{"type":"number"},"minimumOrganizations":{"type":"integer"},"earningsRange":{"type":"number"},"earningsTotal":{"type":"number"},"usersBroughtPayingRange":{"type":"integer"},"usersBroughtPayingTotal":{"type":"integer"},"usersBroughtAllRange":{"type":"integer"},"usersBroughtAllTotal":{"type":"integer"},"orgsBroughtPayingRange":{"type":"integer"},"orgsBroughtPayingTotal":{"type":"integer"},"orgsBroughtAllRange":{"type":"integer"},"orgsBroughtAllTotal":{"type":"integer"},"conversionRateUsersPayingRange":{"type":"number"},"conversionRateUsersPayingTotal":{"type":"number"},"conversionRateUsersAllRange":{"type":"number"},"conversionRateUsersAllTotal":{"type":"number"},"conversionRateOrgsPayingRange":{"type":"number"},"conversionRateOrgsPayingTotal":{"type":"number"},"conversionRateOrgsAllRange":{"type":"number"},"conversionRateOrgsAllTotal":{"type":"number"}}}}}}}}}}}
```

## Request payout

> Request a payout of available commissions.

```json
{"openapi":"3.0.0","info":{"title":"Web API v2 - Public ","version":"1.0.0"},"tags":[{"name":"Affiliate"}],"servers":[{"url":"https://eu1.make.com/api/v2","description":"EU1 production zone"},{"url":"https://eu2.make.com/api/v2","description":"EU2 production zone"},{"url":"https://us1.make.com/api/v2","description":"US1 production zone"},{"url":"https://us2.make.com/api/v2","description":"US2 production zone"},{"url":"https://eu1.make.celonis.com/api/v2","description":"Celonis EU1 production zone"},{"url":"https://us1.make.celonis.com/api/v2","description":"Celonis US1 production zone"}],"security":[{"token":["user:write"]}],"components":{"securitySchemes":{"token":{"type":"apiKey","name":"Authorization","in":"header","description":"Authorize the API call with your API token in the `Authorization` header with the value: `Token your-api-token`.\n\nIf you don't have an API token yet, please refer to the [\"Authentication\" section](/api-documentation/authentication) to learn how to create one.\n"}}},"paths":{"/affiliate/payout-request":{"post":{"tags":["Affiliate"],"summary":"Request payout","description":"Request a payout of available commissions.","responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"integer"}}}}}}}}}}}
```
