Skip to main content
GET
/
api
/
v1
/
lookups
/
units
Get Units of Measure
curl --request GET \
  --url https://api.example.com/api/v1/lookups/units \
  --header 'Authorization: <authorization>' \
  --header 'X-Factus-Token: <x-factus-token>'
{
  "400": {},
  "401": {},
  "success": true,
  "message": "<string>",
  "data": [
    {
      "id": 123,
      "name": "<string>",
      "code": "<string>"
    }
  ],
  "errors": "<any>"
}

Overview

This endpoint returns a list of standard units of measure that can be used when defining products in electronic invoices. Each unit includes its identifier, name, and official code.

Authentication

This endpoint requires both Bearer token authentication and a Factus API token.
Authorization
string
required
Bearer token for API authenticationFormat: Bearer <your_access_token>
X-Factus-Token
string
required
Your Factus API token for accessing the e-invoicing platform

Response

Returns a standardized API response containing an array of unit objects.
success
boolean
Indicates if the request was successful
message
string
Human-readable message about the operation result
data
array
Array of unit of measure objects
id
integer
Unique identifier for the unit
name
string
Name of the unit of measure
code
string
Official unit code (typically following UN/CEFACT standards)
errors
any
default:"null"
Error details if the request failed

Example Request

cURL
curl --request GET \
  --url https://api.yourapp.com/api/v1/lookups/units \
  --header 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...' \
  --header 'X-Factus-Token: your_factus_token_here'

Example Response

200 - Success
{
  "success": true,
  "message": "Unidades obtenidas exitosamente",
  "data": [
    {
      "id": 1,
      "name": "Unidad",
      "code": "94"
    },
    {
      "id": 2,
      "name": "Kilogramo",
      "code": "KGM"
    },
    {
      "id": 3,
      "name": "Metro",
      "code": "MTR"
    },
    {
      "id": 4,
      "name": "Litro",
      "code": "LTR"
    },
    {
      "id": 5,
      "name": "Caja",
      "code": "BX"
    },
    {
      "id": 6,
      "name": "Hora",
      "code": "HUR"
    }
  ],
  "errors": null
}
400 - Bad Request
{
  "detail": "Error al obtener datos de Factus: Invalid token"
}
401 - Unauthorized
{
  "detail": "Not authenticated"
}

Error Responses

400
Bad Request
Invalid request or error communicating with Factus API. Check the detail field for specific error information.
401
Unauthorized
Missing or invalid authentication credentials. Ensure both Authorization header and X-Factus-Token are provided.

Build docs developers (and LLMs) love