Skip to main content

Create good

Method POST

https://my.easyweek.io/api/public/v2/goods

Description: This endpoint creates a good (retail product) in the workspace. The article must be unique within the workspace. Provide the optional initial_stock block to seed stock at a location; omit it (or set initial_stock.is_set to false) to create the good without stock.

Example Request

curl -i -X POST \
https://my.easyweek.io/api/public/v2/goods \
-H 'Authorization: Bearer <YOUR_SECRET>' \
-H 'Workspace: <YOUR_WORKSPACE>'

Request body

{
"name": "Shampoo",
"article": "SKU-123",
"description": null,
"category_uuid": "1a2b3c4d-5e6f-4a1b-8c9d-0e1f2a3b4c5d",
"is_payable": true,
"price": 1500,
"unit": "pcs",
"is_consumable": false,
"consumable_unit": "ml",
"quantity_in_unit": 500,
"initial_stock": {
"is_set": true,
"location_uuid": "123b2980-3506-4f8c-abce-97e1ab653406",
"unit_price": 800,
"quantity": 10,
"critical_stock": 2
},
"images": [],
"live": true,
"live_in_widget": false,
"public_name_translatable": { "en": "Shampoo" },
"public_description_translatable": {}
}

Body Parameters

  • name (string, required): The good's name.
  • article (string, required): A unique article/SKU within the workspace.
  • is_payable (boolean, required): Whether the good can be sold.
  • unit (string, required): The unit of measure (e.g. pcs, ml, l, g, kg).
  • is_consumable (boolean, required): Whether the good is a consumable used by services.
  • price (integer, optional): The sale price in minor units. Required when is_payable is true.
  • description (string, optional): The good's description.
  • category_uuid (string, optional): The UUID of the goods category.
  • consumable_unit (string, optional): The consumable unit. Required when is_consumable is true.
  • quantity_in_unit (integer, optional): Quantity per unit. Required when unit differs from consumable_unit.
  • initial_stock (object, optional): Initial stock block. Fields: is_set (boolean), and when is_set is truelocation_uuid, unit_price, quantity, and optional critical_stock. Omit the block, or set is_set to false, to create the good with no stock.
  • images (array, optional): A list of image paths.
  • live (boolean, optional): Whether the good is active.
  • live_in_widget (boolean, optional): Whether the good is shown in the widget.
  • public_name_translatable (object, optional): Per-locale public names, keyed by locale.
  • public_description_translatable (object, optional): Per-locale public descriptions, keyed by locale.

Example Response

{
"uuid": "9c2f1b7e-2f8a-4a1e-bd2c-6b3a1f9e0d11",
"name": "Shampoo",
"article": "SKU-123",
"category": {
"uuid": "1a2b3c4d-5e6f-4a1b-8c9d-0e1f2a3b4c5d",
"name": "Cosmetics",
"class": "blue"
},
"description": null,
"is_payable": true,
"price": 1500,
"unit": "pcs",
"is_consumable": false,
"consumable_unit": "ml",
"quantity_in_unit": 500,
"stock": 10,
"can_be_set_up_as_consumable": true,
"images": [],
"image": null,
"live": true,
"live_in_widget": false,
"public_name_translatable": { "en": "Shampoo" },
"public_description_translatable": {}
}