Units

A unit represents the unit of a quantity. For example, words or hours.

The unit object

Properties

  • idstring

    Unique identifier for the object.

  • namestring

    The name of the unit.

  • disabledboolean

    True if the unit is disabled.

  • isHoursboolean

    True if the unit represents the hours unit (Used to calculate job with time based pricing).

  • pinnedboolean

    True if the entity is pinned.

unit object

{
  "id": "6548c16d5136b418fd626e61",
  "name": "Words",
  "isHours": false,
  "pinned": true,
  "disabled": false
}

GET/v2/account/quantity-types

List all units

This endpoint allows you to retrieve all the units.

Request

GET
/v2/account/quantity-types
curl -G https://api.lsp.expert/v2/account/quantity-types \
  -u {key}: 

Response

[
  {
    "id": "6548c16d5136b418fd626e61",
    "name": "Words",
    "isHours": false,
    "pinned": true,
    "disabled": false
  },
  {
    "id": "6548c16d5136b418fd626e63",
    "name": "Hours",
    "isHours": true,
    "pinned": false,
    "disabled": false
  },
  {
    "id": "6694d3bb35f2e710ae4a30b6",
    "name": "pages",
    "isHours": false,
    "pinned": false,
    "disabled": false
  }
  // ...
]



POST/v2/account/quantity-types

Create a unit

This endpoint allows you to add a new unit.

Parameters

  • namestring Required

    The name of the unit.

Request

POST
/v2/account/quantity-types
curl https://api.lsp.expert/v2/account/quantity-types \
  -u {key}: \
  -d name="Lines" 

Response

{
  "id": "6694d3bb35f2e710ae4a30b6",
  "name": "Lines",
  "isHours": false,
  "pinned": false,
  "disabled": false
}


PUT/v2/account/quantity-types/:id

Update a unit

This endpoint allows you to perform an update on a unit. Any parameters not provided will be left unchanged.

Parameters

  • namestring

    The name of the unit.

  • disabledboolean

    True if the unit is disabled.

  • pinnedboolean

    True if the entity is pinned.

  • isHoursboolean

    True if the unit represents the hours unit (Used to calculate job with time based pricing).

Request

PUT
/v2/account/quantity-types/:id
curl -X PUT https://api.lsp.expert/v2/account/quantity-types/66e7f69da9d8b6741f4a441d \
  -u {key}: \
  -d name="full"

Response

{
  "id": "66e7f69da9d8b6741f4a441d",
  "name": "full"
}

DELETE/v2/account/quantity-types/:id

Delete a unit

This endpoint allows you to delete a unit.

Request

DELETE
/v2/account/quantity-types/66e7f69da9d8b6741f4a441d
curl -X DELETE https://api.lsp.expert/v2/account/quantity-types/66e7f69da9d8b6741f4a441d \
  -u {key}: