## Create **post** `/products` Creates a new product ### Body Parameters - `code: string` Product code (unique identifier) - `description: string` Description of the product - `paid_by_roles: optional array of object { id } or object { name }` Roles that can pay for this product. Reference roles by id or name. At least one of paid_by_roles or paid_to_roles must be provided. - `RoleMatchByID = object { id }` - `id: string` The unique ID of the role - `RoleMatchByName = object { name }` - `name: string` The name of the role - `paid_to_roles: optional array of object { id } or object { name }` Roles that receive payment for this product. Reference roles by id or name. At least one of paid_by_roles or paid_to_roles must be provided. - `RoleMatchByID = object { id }` - `id: string` The unique ID of the role - `RoleMatchByName = object { name }` - `name: string` The name of the role ### Returns - `data: object { id, code, created, 5 more }` Product object - `id: string` Unique identifier for the product - `code: string` User-defined product identifier. - `created: string` ISO 8601 timestamp when the product was created - `description: string` Description of the product - `paid_by_roles: array of object { id, name }` User roles that can pay for this product - `id: string` The unique ID of the role - `name: string` The name of the role - `paid_to_roles: array of object { id, name }` User roles that receive payment for this product - `id: string` The unique ID of the role - `name: string` The name of the role - `updateVersion: number` Version number for optimistic locking - `workspaceId: string` Workspace ID this product belongs to ### Example ```http curl https://api.us-west-2.fragment.dev/products \ -H 'Content-Type: application/json' \ -d '{ "code": "PROD_001", "description": "Premium subscription service", "paid_by_roles": [ { "name": "buyer" } ], "paid_to_roles": [ { "name": "seller" } ] }' ```