---
title: "Create UserCommissionAssignment"
method: POST
path: "/shop/user-commission-assignments"
tags: ["CommissionPackages"]
---

# Create UserCommissionAssignment

`POST /shop/user-commission-assignments`

Use this endpoint to assign a `CommissionPackage` to a `User` at a
site. Fails with `422` if the user already has an assignment at
that site — update the existing `UserCommissionAssignment` instead.

## Request body

- object
  - `user_id` string, uuid, required — The ID of the `User` to assign the commission package to.
  - `site_id` string, mongo-id, required — The ID of the site this assignment applies to.
  - `commission_package_id` string, mongo-id, required — The ID of the `CommissionPackage` to assign.

## Response `201`

The `UserCommissionAssignment` was successfully retrieved.

- object
  - `data` UserCommissionAssignment, required — Assigns a `CommissionPackage` to a plain `User` at a specific site, mirroring the `commission_package_id` field on `Practitioner` for staff who aren't modelled as practitioners (e.g. front-of-house staff earning commission under a `sold` attribution rate).
    - `id` string, mongo-id, required — The unique identifier of the assignment.
    - `user_id` string, uuid, required — The ID of the `User` this commission package is assigned to.
    - `site_id` string, mongo-id, required — The ID of the site this assignment applies to.
    - `commission_package_id` string, mongo-id, required — The ID of the `CommissionPackage` assigned to the user.
    - `created_at` string, date-time, required
    - `updated_at` string, date-time, required

## Other responses

- `401` — The user is unauthenticated
- `403` — The authenticated user does not have permission.
- `404` — The resource couldn't be found
- `422` — The request didn't pass validation

---

[API](https://skmtc.dev/try/apis/trybe-api.md) · [All operations](https://skmtc.dev/try/apis/trybe-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/try/trybe-api/revisions/f37f92702da5/schema)
