> For the complete documentation index, see [llms.txt](https://api-docs.toconline.pt/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://api-docs.toconline.pt/apis/apis-auxiliares/unidades-de-medida.md).

# Unidades de Medida

### Criar Unidade de Medida

{% openapi src="/files/LrXEg3IjIacAycCz7IWE" path="/api/units\_of\_measure" method="post" %}
[TOConline Open API.yaml](https://1863668386-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fk7sif7BY0rPzivMcj1HB%2Fuploads%2Fgit-blob-1f7bd9dd692716d3f3f93d9c9a4f7226d78277e3%2FTOConline%20Open%20API.yaml?alt=media)
{% endopenapi %}

{% tabs %}
{% tab title="Payload" %}
{% code title="Payload" %}

```json
{
    "data": {
        "type": "units_of_measure",
        "attributes": {
            "unit_of_measure": "Anos de Luz",
            "is_default": false
        }
    }
}

```

{% endcode %}
{% endtab %}

{% tab title="Response" %}
{% code title="Response" %}

```json
{
    "data": {
        "type": "units_of_measure",
        "id": "9",
        "attributes": {
            "unit_of_measure": "Anos de Luz",
            "is_default": false
        },
        "relationships": {
            "company": {
                "data": {
                    "type": "current_company",
                    "id": "800000046"
                }
            }
        }
    }
}
```

{% endcode %}
{% endtab %}
{% endtabs %}

###

### Obter Todas as Unidade de Medida

{% openapi src="/files/LrXEg3IjIacAycCz7IWE" path="/api/units\_of\_measure" method="get" %}
[TOConline Open API.yaml](https://1863668386-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fk7sif7BY0rPzivMcj1HB%2Fuploads%2Fgit-blob-1f7bd9dd692716d3f3f93d9c9a4f7226d78277e3%2FTOConline%20Open%20API.yaml?alt=media)
{% endopenapi %}

{% code title="GET" %}

```
https://api/v1.toconline.com/api/units_of_measure
```

{% endcode %}

<details>

<summary>Exemplo de Response</summary>

```json
{
    "data": [
        {
            "type": "units_of_measure",
            "id": "6",
            "attributes": {
                "unit_of_measure": "horas",
                "is_default": false
            },
            "relationships": {
                "company": {
                    "data": {
                        "type": "current_company",
                        "id": "800000046"
                    }
                }
            }
        },
        {
            "type": "units_of_measure",
            "id": "5",
            "attributes": {
                "unit_of_measure": "Kg",
                "is_default": false
            },
            "relationships": {
                "company": {
                    "data": {
                        "type": "current_company",
                        "id": "800000046"
                    }
                }
            }
        },
        {
            "type": "units_of_measure",
            "id": "4",
            "attributes": {
                "unit_of_measure": "Lt",
                "is_default": false
            },
            "relationships": {
                "company": {
                    "data": {
                        "type": "current_company",
                        "id": "800000046"
                    }
                }
            }
        },
        {
            "type": "units_of_measure",
            "id": "3",
            "attributes": {
                "unit_of_measure": "m",
                "is_default": false
            },
            "relationships": {
                "company": {
                    "data": {
                        "type": "current_company",
                        "id": "800000046"
                    }
                }
            }
        },
        {
            "type": "units_of_measure",
            "id": "2",
            "attributes": {
                "unit_of_measure": "un",
                "is_default": true
            },
            "relationships": {
                "company": {
                    "data": {
                        "type": "current_company",
                        "id": "800000046"
                    }
                }
            }
        },
        {
            "type": "units_of_measure",
            "id": "9",
            "attributes": {
                "unit_of_measure": "Anos de Luz",
                "is_default": false
            },
            "relationships": {
                "company": {
                    "data": {
                        "type": "current_company",
                        "id": "800000046"
                    }
                }
            }
        }
    ]
}
```

</details>

###

### Remover Unidades de Medida

{% openapi src="/files/LrXEg3IjIacAycCz7IWE" path="/api/units\_of\_measure/{unitsOfMeasureId}" method="delete" %}
[TOConline Open API.yaml](https://1863668386-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fk7sif7BY0rPzivMcj1HB%2Fuploads%2Fgit-blob-1f7bd9dd692716d3f3f93d9c9a4f7226d78277e3%2FTOConline%20Open%20API.yaml?alt=media)
{% endopenapi %}

{% code title="DELETE" %}

```
https://api/v1.toconline.com/api/units_of_measure/{id}
```

{% endcode %}

<details>

<summary>Exemplo de Response</summary>

```json
{
    "meta": {}
}
```

</details>
