Zum Hauptinhalt springen
POST
/
api
/
commissions
/
plans
Create a commission plan
curl --request POST \
  --url https://coreapi.io/api/commissions/plans \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "<string>",
  "type": "ongoing_percentage",
  "percentage": "0.10",
  "triggerEvent": "invoice_finalized",
  "commissionScope": "all_invoices",
  "requireDeal": false,
  "payoutThresholdAmount": {
    "amount": 123,
    "currency": "EUR",
    "precision": 2
  },
  "monthlyRevenueThreshold": {
    "amount": 123,
    "currency": "EUR",
    "precision": 2
  },
  "rules": [
    {
      "productId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "externalProductReference": "<string>",
      "percentage": "0.20",
      "priority": 0
    }
  ]
}
'
{
  "id": "<string>",
  "name": "<string>",
  "type": "<string>",
  "percentage": "<string>",
  "basisType": "<string>",
  "triggerEvent": "<string>",
  "commissionScope": "<string>",
  "requireDeal": true,
  "payoutThresholdAmount": {
    "amount": 123,
    "displayAmount": 123,
    "currency": "<string>",
    "precision": 123
  },
  "monthlyRevenueThreshold": {
    "amount": 123,
    "displayAmount": 123,
    "currency": "<string>",
    "precision": 123
  },
  "isActive": true,
  "rules": [
    {
      "id": "<string>",
      "productId": "<string>",
      "externalProductReference": "<string>",
      "percentage": "<string>",
      "priority": 123
    }
  ],
  "createdAt": "2023-11-07T05:31:56Z",
  "updatedAt": "2023-11-07T05:31:56Z"
}

Autorisierungen

Authorization
string
header
erforderlich

Bearer token of your Organisation with the commission-plans permission (read for GET, write for POST/PUT/DELETE). Send it as Authorization: Bearer .

Body

application/json
name
string
erforderlich

Internal name of the plan.

Maximum string length: 255
type
enum<string>
Standard:ongoing_percentage

How the commission is calculated.

Verfügbare Optionen:
ongoing_percentage
percentage
string | null

Base commission rate as a decimal fraction (0.10 = 10 %).

Beispiel:

"0.10"

basisType
enum<string> | null

Whether the commission is based on the net or gross invoice amount.

Verfügbare Optionen:
net,
gross
triggerEvent
enum<string>
Standard:invoice_finalized

When the commission is calculated.

Verfügbare Optionen:
invoice_finalized,
invoice_paid
commissionScope
enum<string>
Standard:all_invoices

Which invoices generate commission.

Verfügbare Optionen:
all_invoices,
first_contract_period
requireDeal
boolean
Standard:false

When true, only invoices linked to a deal generate commission.

payoutThresholdAmount
object

Minimum commission a sales rep must accumulate on this plan within a calendar month for that month's commissions to be paid out. Evaluated per sales rep, per plan, per month. Null means no minimum.

monthlyRevenueThreshold
object

Minimum invoice revenue a sales rep must generate on this plan within a calendar month before any commission for that month is paid out. If the revenue stays below this, the whole month is withheld. Evaluated per sales rep, per plan, per month. Null means no minimum.

rules
object[]

Antwort

The created commission plan.

id
string
name
string
type
string
percentage
string | null

Base commission rate as a decimal fraction.

basisType
string | null
triggerEvent
string
commissionScope
string
requireDeal
boolean
payoutThresholdAmount
object

Minimum commission a sales rep must accumulate on this plan within a calendar month for that month's commissions to be paid out. Evaluated per sales rep, per plan, per month. Null means no minimum.

monthlyRevenueThreshold
object

Minimum invoice revenue a sales rep must generate on this plan within a calendar month before any commission for that month is paid out. If the revenue stays below this, the whole month is withheld. Evaluated per sales rep, per plan, per month. Null means no minimum.

isActive
boolean
rules
object[]
createdAt
string<date-time>
updatedAt
string<date-time>