Hoppa till innehållet

Commissions

Sales agents' commission settlements: paid invoices and credit notes per agent, one line per invoice and sales order, settled once. Addressed by settlementNumber. The agent and the commission terms are set on the sales order and the quote in Fluit.

4 anrop GET POST Bas-URL https://api.fluit.cloud/preview

Autentisering, felkoder, rate limits, idempotens och paginering gäller alla anrop och står samlade under Kom igång.

GET /commission-settlements

List commission settlements

Returns sales agents' commission settlements, newest first, each with its lines: one per invoice and sales order, credit notes negative. Amounts are in the tenant's base currency. The response is paged: items , totalCount , page and pageSize .

commissions:read

Frågeparametrar

Fält Typ Beskrivning
agentCustomerNumber string Returns only the settlements of the sales agent with this customer number.
status enum Filters on the settlement's status. Draft Approved Paid Cancelled
page integer Page to return, 1-based. Default 1.
pageSize integer Number of records per page. Default 50, max 200.

Svar

200 PagedResult_PublicCommissionSettlementResponse

Paginerat svar: raderna nedan ligger i items[], omgivna av totalCount, page, pageSize, totalPages, hasPreviousPage och hasNextPage. Paginerad

Fält Typ Beskrivning
agentCustomerNumber string · nullable Customer number of the sales agent.
agentName string · nullable
approvedAt string(date-time) · nullable
currencyCode string · nullable ISO 4217 base currency of every amount.
lines CommissionSettlementLine[] · nullable
paidDate string(date) · nullable
settlementNumber string · nullable Unique settlement number, e.g. PROV-2026-00001 .
status enum Lifecycle of a commission settlement. Draft Approved Paid Cancelled
toDate string(date) Paid invoices and credit notes up to and including this date are included.
totalBasisAmount decimal
totalCommissionAmount decimal
400 ProblemDetails Unknown status.
Fält Typ
detail string · nullable
instance string · nullable
status integer · nullable
title string · nullable
type string · nullable

Standardfel: 401 403 Felhantering

Exempel

curl
curl "https://api.fluit.cloud/preview/commission-settlements" \
  -H "X-Api-Key: fluit_live_sk_..."
Svar 200
{
  "aggregates": [
    {
      "currencyCode": "SEK",
      "key": "string",
      "mixedCurrencies": true,
      "value": "299.00"
    }
  ],
  "hasNextPage": true,
  "hasPreviousPage": true,
  "items": [
    {
      "agentCustomerNumber": "ABC-001",
      "agentName": "Acme AB",
      "approvedAt": "2026-06-11T09:24:13.418",
      "currencyCode": "SEK",
      "lines": [
        {
          "basisAmount": "299.00",
          "commissionAmount": "299.00",
          "commissionRate": "299.00",
          "commissionType": "Percent",
          "customerName": "Acme AB",
          "invoiceDate": "2026-06-11",
          "invoiceNumber": "INV-2026-0912",
          "isCreditNote": true,
          "orderNumber": "SO-2026-1041"
        }
      ],
      "paidDate": "2026-06-11",
      "settlementNumber": "ABC-001",
      "status": "Draft",
      "toDate": "2026-06-11",
      "totalBasisAmount": "299.00",
      "totalCommissionAmount": "299.00"
    }
  ],
  "page": 1,
  "pageSize": 50,
  "totalCount": 137,
  "totalPages": 3
}

Bas-URL https://api.fluit.cloud/preview. Svarsexemplet är genererat ur schemat: formen stämmer, värdena är påhittade.

POST /commission-settlements

Create a commission settlement

Creates a draft settlement with every paid invoice and credit note of the agent dated up to and including toDate whose commission has not been settled. An invoice is settled once. Approve it with POST /preview/commission-settlements/{settlementNumber}/approve .

commissions:write Kräver Idempotency-Key

Body krävs

Fält Typ Beskrivning
agentCustomerNumber Krävs string Customer number of the sales agent (a customer with the Agent role).
notes string · nullable Optional note on the settlement.
toDate Krävs string(date) Paid invoices and credit notes dated up to and including this date are included.

Svar

201 PublicCommissionSettlementResponse
  • Location — URL of the newly created resource.
Fält Typ Beskrivning
agentCustomerNumber string · nullable Customer number of the sales agent.
agentName string · nullable
approvedAt string(date-time) · nullable
currencyCode string · nullable ISO 4217 base currency of every amount.
lines CommissionSettlementLine[] · nullable
paidDate string(date) · nullable
settlementNumber string · nullable Unique settlement number, e.g. PROV-2026-00001 .
status enum Lifecycle of a commission settlement. Draft Approved Paid Cancelled
toDate string(date) Paid invoices and credit notes up to and including this date are included.
totalBasisAmount decimal
totalCommissionAmount decimal
400 ProblemDetails The customer is not a sales agent ( Commission.NotAnAgent ), or there is nothing to settle ( CommissionSettlement.NothingToSettle ).
Fält Typ
detail string · nullable
instance string · nullable
status integer · nullable
title string · nullable
type string · nullable
409 ProblemDetails Another settlement took the same invoices at the same time ( CommissionSettlement.ConcurrentSettlement ).
Fält Typ
detail string · nullable
instance string · nullable
status integer · nullable
title string · nullable
type string · nullable

Standardfel: 401 403 Felhantering

Exempel

curl
curl -X POST "https://api.fluit.cloud/preview/commission-settlements" \
  -H "X-Api-Key: fluit_live_sk_..." \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d @body.json
Svar 201
{
  "agentCustomerNumber": "ABC-001",
  "agentName": "Acme AB",
  "approvedAt": "2026-06-11T09:24:13.418",
  "currencyCode": "SEK",
  "lines": [
    {
      "basisAmount": "299.00",
      "commissionAmount": "299.00",
      "commissionRate": "299.00",
      "commissionType": "Percent",
      "customerName": "Acme AB",
      "invoiceDate": "2026-06-11",
      "invoiceNumber": "INV-2026-0912",
      "isCreditNote": true,
      "orderNumber": "SO-2026-1041"
    }
  ],
  "paidDate": "2026-06-11",
  "settlementNumber": "ABC-001",
  "status": "Draft",
  "toDate": "2026-06-11",
  "totalBasisAmount": "299.00",
  "totalCommissionAmount": "299.00"
}

Bas-URL https://api.fluit.cloud/preview. Svarsexemplet är genererat ur schemat: formen stämmer, värdena är påhittade.

GET /commission-settlements/{settlementNumber}

Get a commission settlement

Returns the settlement with one line per invoice and sales order: the commissionable net amount, the commission type and rate, and the commission. Credit notes are negative. Amounts are in the tenant's base currency. Responses carry a weak ETag; pass it back in If-None-Match to get 304 Not Modified while the settlement is unchanged.

commissions:read Stödjer ETag

Sökvägsparametrar

Fält Typ Beskrivning
settlementNumber Krävs string Number of the settlement, e.g. PROV-2026-00001.

Svar

200 PublicCommissionSettlementResponse
  • ETag — Weak validator for this representation. Pass it back in If-None-Match to get 304 Not Modified while the record is unchanged.
Fält Typ Beskrivning
agentCustomerNumber string · nullable Customer number of the sales agent.
agentName string · nullable
approvedAt string(date-time) · nullable
currencyCode string · nullable ISO 4217 base currency of every amount.
lines CommissionSettlementLine[] · nullable
paidDate string(date) · nullable
settlementNumber string · nullable Unique settlement number, e.g. PROV-2026-00001 .
status enum Lifecycle of a commission settlement. Draft Approved Paid Cancelled
toDate string(date) Paid invoices and credit notes up to and including this date are included.
totalBasisAmount decimal
totalCommissionAmount decimal
304 Tom body.
  • ETag — Weak validator for this representation. Pass it back in If-None-Match to get 304 Not Modified while the record is unchanged.
404 ProblemDetails No settlement with that number.
Fält Typ
detail string · nullable
instance string · nullable
status integer · nullable
title string · nullable
type string · nullable

Standardfel: 401 403 Felhantering

Exempel

curl
curl "https://api.fluit.cloud/preview/commission-settlements/{settlementNumber}" \
  -H "X-Api-Key: fluit_live_sk_..."
Svar 200
{
  "agentCustomerNumber": "ABC-001",
  "agentName": "Acme AB",
  "approvedAt": "2026-06-11T09:24:13.418",
  "currencyCode": "SEK",
  "lines": [
    {
      "basisAmount": "299.00",
      "commissionAmount": "299.00",
      "commissionRate": "299.00",
      "commissionType": "Percent",
      "customerName": "Acme AB",
      "invoiceDate": "2026-06-11",
      "invoiceNumber": "INV-2026-0912",
      "isCreditNote": true,
      "orderNumber": "SO-2026-1041"
    }
  ],
  "paidDate": "2026-06-11",
  "settlementNumber": "ABC-001",
  "status": "Draft",
  "toDate": "2026-06-11",
  "totalBasisAmount": "299.00",
  "totalCommissionAmount": "299.00"
}

Bas-URL https://api.fluit.cloud/preview. Svarsexemplet är genererat ur schemat: formen stämmer, värdena är påhittade.

POST /commission-settlements/{settlementNumber}/approve

Approve a commission settlement

Fixes the amount of a draft settlement. It is then paid out to the agent, as a supplier invoice from Fluit or through payroll, and marked as paid in Fluit.

commissions:write Kräver Idempotency-Key

Sökvägsparametrar

Fält Typ Beskrivning
settlementNumber Krävs string Number of the draft settlement to approve.

Svar

204 Tom body.
404 ProblemDetails No settlement with that number.
Fält Typ
detail string · nullable
instance string · nullable
status integer · nullable
title string · nullable
type string · nullable
409 ProblemDetails The settlement is not a draft ( CommissionSettlement.NotDraft ).
Fält Typ
detail string · nullable
instance string · nullable
status integer · nullable
title string · nullable
type string · nullable

Standardfel: 401 403 Felhantering

Exempel

curl
curl -X POST "https://api.fluit.cloud/preview/commission-settlements/{settlementNumber}/approve" \
  -H "X-Api-Key: fluit_live_sk_..." \
  -H "Idempotency-Key: $(uuidgen)"
Svar 404
{
  "detail": "string",
  "instance": "string",
  "status": 42,
  "title": "string",
  "type": "string"
}

Bas-URL https://api.fluit.cloud/preview. Svarsexemplet är genererat ur schemat: formen stämmer, värdena är påhittade.

Scheman

Objekten som gruppens anrop refererar till. Fälttabellerna ovan går ett steg djupt och länkar hit i stället för att upprepa samma schema på varje endpoint.

CommissionSettlementLine

PublicCommissionSettlementLine

One invoice and sales order in a settlement. Credit notes carry negative amounts.

Fält Typ Beskrivning
basisAmount decimal Commissionable net amount in the base currency. Serialised as a decimal string.
commissionAmount decimal Commission in the base currency. Serialised as a decimal string.
commissionRate decimal The percent, or the order's fixed amount. Serialised as a decimal string.
commissionType enum How the commission on a deal is calculated. Percent FixedAmount
customerName string · nullable Invoice customer — the end customer the agent brokered the deal to.
invoiceDate string(date)
invoiceNumber string · nullable
isCreditNote boolean True for a credit note, which deducts commission.
orderNumber string · nullable Sales order the invoice lines came from. Null for manually added invoice lines.