Create a commission formula
const url = 'https://example.com/api/v1/commission-formulas';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"partner_id":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","workspace_id":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","schema_id":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","name":"example","description":"example","start_datetime":"2026-04-15T12:00:00Z","end_datetime":"2026-04-15T12:00:00Z","currency":"example","expression":{"type":"literal","value":{"type":"number","value":1}}}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://example.com/api/v1/commission-formulas \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "partner_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "workspace_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "schema_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "name": "example", "description": "example", "start_datetime": "2026-04-15T12:00:00Z", "end_datetime": "2026-04-15T12:00:00Z", "currency": "example", "expression": { "type": "literal", "value": { "type": "number", "value": 1 } } }'Authorizations
Section titled “Authorizations ”Request Body required
Section titled “Request Body required ”object
ID of the partner this formula belongs to
ID of the workspace this formula belongs to
ID of the attribution schema this formula is associated with
Name of the commission formula
Optional description of the commission formula
Date and time from which this formula is active
Date and time until which this formula is active
ISO 4217 currency code (e.g. EUR, USD)
Updated expression formula (omit to leave unchanged)
object
object
object
object
Updated expression formula (omit to leave unchanged)
object
Name of the attribution attribute
Updated expression formula (omit to leave unchanged)
object
Name of the property key in the attribution’s dynamic property bag
Updated expression formula (omit to leave unchanged)
object
object
object
object
object
object
object
object
object
object
object
Updated expression formula (omit to leave unchanged)
object
object
object
Updated expression formula (omit to leave unchanged)
object
Responses
Section titled “ Responses ”Commission formula created successfully
object
ID of the newly created commission formula
Example generated
{ "id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0"}Bad request
object
Example
{ "error_code": "UNAUTHORIZED", "message": "Authentication credentials were not provided or are invalid."}Unauthorized
object
Example
{ "error_code": "UNAUTHORIZED", "message": "Authentication credentials were not provided or are invalid."}Internal server error
object
Example
{ "error_code": "UNAUTHORIZED", "message": "Authentication credentials were not provided or are invalid."}