How to save an Opcode
Use this endpoint to create a new labor opcode (operation code) for a dealer department, or to update an existing one. Opcodes define services that can be attached to appointments (e.g. oil change, tire rotation).
For errors and warnings that this endpoint can return, see Save opcode — Errors and warnings.
Overview
- POST — Creates a new opcode. Include
opcode.uuidwhen updating an existing opcode (same as create payload with the opcode’s UUID). - PUT — Use PUT to update an existing opcode when you get
OPCODE_ALREADY_EXISTSfor a given labor code. - Required —
laborOpCodeis mandatory. You need the department UUID (from integration) and the opcode payload below.
What you need
| Parameter | Description |
|---|---|
dealerDepartmentUuid | Dealer department identifier (from integration). |
| Opcode payload | JSON body with an opcode object (see Request body). For updates, include the existing opcode uuid (e.g. from Get opcodes and menus). |
Request
HTTP request
POST https://api.mykaarma.com/appointment/v2/department/{dealerDepartmentUuid}/opcode
Path parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
dealerDepartmentUuid | String | Unique identifier of the dealer department | Yes |
Request body
Send a JSON object with:
| Field | Description |
|---|---|
opcode | Object with labor opcode fields (see example). Required: laborOpCode. For update, include uuid of the existing opcode. |
errorOnDuplicate | If true, return an error when an opcode with the same labor code already exists. Default: false. |
eventDealerAssociateUuid | Optional; dealer associate UUID for event context. |
Key opcode fields include: laborOpCode, opCodeName, description, totalPrice, opCodeDurationInMinutes, isValid, uuid (for update), and many optional DMS/scheduler flags (e.g. inOnlineScheduler, inServiceCart).
Example
Replace {{dealerDepartmentUuid}} and {{opcodeUUID}} (for update) with your values. For a new opcode, omit the uuid field or set it to null.
curl --location -g --request POST 'https://api.mykaarma.com/appointment/v2/department/{{dealerDepartmentUuid}}/opcode' \
--header 'Content-Type: application/json' \
--data-raw '{
"opcode": {
"laborOpCode": "RBALANCEI",
"opCodeName": "ROAD FORCE BALANCE AND ROTATE NO STAGGERED WHEELS",
"description": "ROAD FORCE BALANCE AND ROTATE NO STAGGERED WHEELS",
"totalPrice": "85.00",
"opCodeDurationInMinutes": "30",
"isValid": true,
"uuid": "{{opcodeUUID}}",
"inMobileService": false,
"inOnlineScheduler": false,
"communicationCode": null,
"payType": null,
"inServiceCart": true,
"inDealerAppScheduler": false,
"dmsDescription": "DATACLOVER APPOINTMENT",
"laborPrice": "85.00",
"dmsLaborPrice": null,
"partsPrice": "0.0",
"dmsPartsPrice": null,
"taxAmount": null,
"dmsTaxAmount": null,
"dmsTotalPrice": null,
"sortOrder": null,
"correction": "DATACLOVER APPOINTMENT",
"cause": null,
"soldHours": 0.8,
"dispatchCode": null,
"comebackFlag": true,
"usagePercentile": null,
"position": 0,
"leadTimeInMinutes": null,
"isIndexed": false,
"isDefault": false,
"notes": null,
"recallId": null,
"vehicleMileageConfigList": null,
"dailyLimitConfigList": null,
"pullEstimateInSC": false,
"miscPrice": null,
"useDmsPrice": null,
"showDmsPriceMismatchWarning": null
},
"errorOnDuplicate": false,
"eventDealerAssociateUuid": null
}'
If the API returns OPCODE_ALREADY_EXISTS, use PUT to the same path (or the update opcode endpoint) with the existing opcode UUID to update instead of create.