### GET /payments Source: https://www.holded.com/es/desarrolladores/referencia-api/pagos/listado-de-pagos Devuelve la lista de todos los métodos de pago configurados en tu cuenta. ```APIDOC ## GET /payments ### Description Devuelve la lista de todos los métodos de pago configurados en tu cuenta. ### Method GET ### Endpoint `https://api.holded.com/api/v2/payments` ### Parameters #### Query Parameters - **start_date** (string) - opcional - Filtrar pagos desde esta fecha y hora - **end_date** (string) - opcional - Filtrar pagos hasta esta fecha y hora - **document_id** (string) - opcional - Filtrar pagos vinculados a este documento - **document_type** (string) - opcional - Filtrar pagos por tipo de documento - **cursor** (string) - opcional - Cursor opaco para paginación - **limit** (integer) - opcional - Número máximo de pagos a devolver por página (default: 50) ### Request Example ```python import requests url = "https://api.holded.com/api/v2/payments?start_date=2024-01-01T00:00:00+00:00&end_date=2024-12-31T23:59:59+00:00&document_id=value" headers = { "Authorization": "Bearer YOUR_API_KEY", "Accept": "application/json", } response = requests.get(url, headers=headers) print(response.json()) ``` ### Response #### Success Response (200) - **items** (object[]) - Lista de pagos. - **id** (string) - Identificador único del pago. - **bank_account_id** (string | null) - Identificador de la cuenta bancaria. - **contact_id** (string | null) - Identificador del contacto. - **contact_name** (string | null) - Nombre de visualización del contacto. - **amount** (string) - Monto del pago como cadena decimal. - **description** (string | null) - Descripción del pago. - **date** (string) - Fecha del pago en formato ISO 8601. - **status** (string) - Estado del pago (Enum: `no_paid`, `paid`, `partial_paid`). - **reconciliation_status** (string) - Estado de la conciliación bancaria (Enum: `pending`, `reconciled`, `partial_reconciled`). - **total_documents** (string) - Monto total vinculado a documentos. - **total_transactions** (string) - Monto total vinculado a transacciones. - **total_advance** (string) - Monto total vinculado a pagos anticipados. - **document_type** (string | null) - Tipo del documento vinculado. - **document_id** (string | null) - Identificador del documento vinculado. - **cursor** (string | null) - Cursor opaco para paginación. - **has_more** (boolean) - Indica si hay más resultados disponibles. #### Response Example ```json { "items": [ { "id": "507f1f77bcf86cd799439011", "bank_account_id": "string", "contact_id": "string", "contact_name": "string", "amount": "1500.50", "description": "string", "date": "2024-01-15T10:30:00+00:00", "status": "no_paid" } ], "cursor": "string", "has_more": false } ``` #### Error Responses - **401** - API key inválida o no proporcionada (application/json) - **403** - Permisos insuficientes (application/json) - **429** - Límite de solicitudes excedido (application/json) ``` -------------------------------- ### Crear método de pago con Python Source: https://www.holded.com/es/desarrolladores/referencia-api/metodos-de-pago/crear-un-metodo-de-pago Utiliza este snippet para crear un nuevo método de pago manual. Asegúrate de reemplazar 'YOUR_API_KEY' con tu clave de API real y ajusta los valores de 'name', 'dueDays' y 'bankId' según tus necesidades. ```python import requests url = "https://api.holded.com/api/v2/payment-methods" headers = { "Authorization": "Bearer YOUR_API_KEY", "Accept": "application/json", } payload = { "name": "string", "dueDays": 0, "bankId": "string" } response = requests.post(url, headers=headers, json=payload) print(response.json()) ``` -------------------------------- ### List Numbering Series by Document Type - TypeScript Source: https://www.holded.com/es/desarrolladores/referencia-api/series-de-numeracion/listar-series-de-numeracion-por-tipo-de-documento This TypeScript example demonstrates how to make a GET request to retrieve numbering series. Replace '{type}' with the desired document type and 'YOUR_API_KEY' with your valid API key. ```typescript fetch("https://api.holded.com/api/v2/numbering-series/{type}", { method: "GET", headers: { "Authorization": "Bearer YOUR_API_KEY", "Accept": "application/json", }, }) .then((response) => response.json()) .then((data) => console.log(data)); ``` -------------------------------- ### Obtener resumen de proyecto (Python) Source: https://www.holded.com/es/desarrolladores/referencia-api/proyectos/obtener-resumen-de-un-proyecto Utiliza la librería requests para realizar una petición GET a la API de Holded y obtener el resumen de un proyecto. Asegúrate de reemplazar YOUR_API_KEY con tu clave de API y {projectId} con el ID del proyecto. ```python import requests url = "https://api.holded.com/api/v2/projects/{projectId}/summary" headers = { "Authorization": "Bearer YOUR_API_KEY", "Accept": "application/json", } response = requests.get(url, headers=headers) print(response.json()) ``` -------------------------------- ### API Request Examples Source: https://www.holded.com/es/desarrolladores Examples of common API requests to interact with Holded resources. ```bash GET /api/v2/invoices ``` ```bash POST /api/v2/contacts ``` ```bash GET /api/v2/products ``` ```bash PUT /api/v2/invoices/5f3a.. ``` ```bash GET /api/v2/treasuries ``` -------------------------------- ### Crear un producto simple Source: https://www.holded.com/es/desarrolladores/referencia-api/productos/crear-un-producto Utiliza este endpoint para añadir un nuevo producto estándar a tu catálogo. Asegúrate de incluir el nombre, el tipo ('simple') y si el seguimiento de stock y la disponibilidad para venta/compra están habilitados. ```Python import requests url = "https://api.holded.com/api/v2/products" headers = { "Authorization": "Bearer YOUR_API_KEY", "Accept": "application/json", } payload = { "name": "string", "kind": "simple", "description": "string", "sku": "string", "barcode": "string", "price": "99.95", "cost": "49.99", "tags": [ "string" ] } response = requests.post(url, headers=headers, json=payload) print(response.json()) ``` -------------------------------- ### Example transaction response Source: https://www.holded.com/es/desarrolladores/referencia-api/cuentas-bancarias/listado-de-todas-las-transacciones-de-cuentas-bancarias This is an example of the JSON response structure when successfully retrieving a list of bank account transactions. ```json { "items": [ { "id": "507f1f77bcf86cd799439011", "banking_account_id": "507f1f77bcf86cd799439012", "contact_name": "Acme Corp", "amount": "1500.00", "description": "string", "date": "2024-01-15T10:30:00Z", "reconciliation_status": "pending", "total_documents": "0.00" } ], "cursor": "string", "has_more": false } ``` -------------------------------- ### Example API Response - Numbering Series Source: https://www.holded.com/es/desarrolladores/referencia-api/series-de-numeracion/listar-series-de-numeracion-por-tipo-de-documento This is an example of a successful JSON response when listing numbering series. It includes details like the series ID, name, format, and last used number. ```json { "items": [ { "id": "507f1f77bcf86cd799439011", "name": "Factura principal", "format": "INV-%[YYYY]-%", "last": 150, "type": "invoice", "refund_numbering_series_id": null, "verifactu_excluded": false } ] } ``` -------------------------------- ### Listado de productos con paginación Source: https://www.holded.com/es/desarrolladores/referencia-api/productos/listado-de-productos Utiliza este código para obtener una lista paginada de productos. Asegúrate de reemplazar 'YOUR_API_KEY' con tu clave de API real y ajusta los parámetros `cursor` y `limit` según sea necesario. ```python import requests url = "https://api.holded.com/api/v2/products?cursor=value&limit=50" headers = { "Authorization": "Bearer YOUR_API_KEY", "Accept": "application/json", } response = requests.get(url, headers=headers) print(response.json()) ``` ```typescript import fetch from 'node-fetch'; const url = `https://api.holded.com/api/v2/products?cursor=value&limit=50`; const headers = { "Authorization": "Bearer YOUR_API_KEY", "Accept": "application/json", }; fetch(url, { headers }) .then(response => response.json()) .then(data => console.log(data)) .catch(error => console.error(error)); ``` ```javascript const url = `https://api.holded.com/api/v2/products?cursor=value&limit=50`; const headers = { "Authorization": "Bearer YOUR_API_KEY", "Accept": "application/json", }; fetch(url, { headers }) .then(response => response.json()) .then(data => console.log(data)) .catch(error => console.error(error)); ``` ```go package main import ( "encoding/json" "fmt" "log" "github.com/valyala/fasthttp" ) func main() { req := fasthttp.AcquireRequest() resp := fasthttp.AcquireResponse() defer fasthttp.ReleaseRequest(req) defer fasthttp.ReleaseResponse(resp) url := "https://api.holded.com/api/v2/products?cursor=value&limit=50" req.SetRequestURI(url) req.Header.Set("Authorization", "Bearer YOUR_API_KEY") req.Header.Set("Accept", "application/json") err := fasthttp.Do(req, resp) if err != nil { log.Fatalf("Error making request: %v", err) } var data map[string]interface{} err = json.Unmarshal(resp.Body(), &data) if err != nil { log.Fatalf("Error unmarshalling response: %v", err) } fmt.Println(data) } ``` ```ruby require 'net/http' require 'uri' uri = URI.parse("https://api.holded.com/api/v2/products?cursor=value&limit=50") request = Net::HTTP::Get.new(uri) request["Authorization"] = "Bearer YOUR_API_KEY" request["Accept"] = "application/json" response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == 'https') do |http| http.request(request) end puts JSON.parse(response.body) ``` ```php ``` ```curl curl -X GET \ 'https://api.holded.com/api/v2/products?cursor=value&limit=50' \ -H 'Authorization: Bearer YOUR_API_KEY' \ -H 'Accept: application/json' ``` -------------------------------- ### Actualizar stock de producto (Python) Source: https://www.holded.com/es/desarrolladores/referencia-api/productos/actualizar-el-stock-de-un-producto Utiliza esta petición para ajustar la cantidad de stock de un producto en un almacén. Asegúrate de incluir tu clave API y los detalles del producto y almacén. ```python import requests url = "https://api.holded.com/api/v2/products/{productId}/stock" headers = { "Authorization": "Bearer YOUR_API_KEY", "Accept": "application/json", } payload = { "warehouse_id": "string", "variant_id": "string", "stock_variation": 0, "description": "string" } response = requests.put(url, headers=headers, json=payload) print(response.json()) ``` -------------------------------- ### Example MCP Interaction: Listing Unpaid Invoices Source: https://www.holded.com/es/desarrolladores/mcp Demonstrates how an AI assistant might call the list_invoices function to check for pending payments. This is an example of a natural language query translated into an API call. ```text Llamando a list_invoices(status="unpaid")... ``` -------------------------------- ### Obtener Listado de Presupuestos (Python) Source: https://www.holded.com/es/desarrolladores/referencia-api/presupuestos/listado-de-presupuestos Realiza una petición GET a la API para obtener un listado de presupuestos. Incluye parámetros de consulta para limitar y paginar los resultados, y un encabezado de autorización. Asegúrate de reemplazar 'YOUR_API_KEY' con tu clave de API real. ```python import requests url = "https://api.holded.com/api/v2/estimates?limit=50&page=0&contact_id=value" headers = { "Authorization": "Bearer YOUR_API_KEY", "Accept": "application/json", } response = requests.get(url, headers=headers) print(response.json()) ``` -------------------------------- ### Update Numbering Series - Response Example Source: https://www.holded.com/es/desarrolladores/referencia-api/series-de-numeracion/actualizar-una-serie-de-numeracion This is an example of a successful JSON response when updating a numbering series. It includes the series ID, name, format, last used number, type, and Verifactu exclusion status. ```json { "id": "507f1f77bcf86cd799439011", "name": "Factura principal", "format": "INV-%[YYYY]-%", "last": 150, "type": "invoice", "refund_numbering_series_id": null, "verifactu_excluded": false } ``` -------------------------------- ### Example API Response Source: https://www.holded.com/es/desarrolladores/referencia-api/control-horario-de-empleados/listar-registros-de-tiempo-de-un-empleado This is an example of the JSON response structure you can expect when successfully retrieving a list of employee time records. It includes details such as record ID, employee information, dates, start/end times, duration, and status. ```json { "items": [ { "id": "507f1f77bcf86cd799439011", "employee_id": "507f1f77bcf86cd799439012", "employee_name": "string", "date": "2024-01-15T10:30:00Z", "start_at": "2024-01-15T10:30:00Z", "end_at": "2024-01-15T10:30:00Z", "duration": 0, "status": "string" } ] } ``` -------------------------------- ### Actualizar un producto con Python Source: https://www.holded.com/es/desarrolladores/referencia-api/productos/actualizar-un-producto Utiliza este snippet para actualizar un producto existente enviando una petición PUT a la API. Asegúrate de reemplazar 'YOUR_API_KEY' con tu clave de API real y '{productId}' con el ID del producto a actualizar. El payload contiene los campos que deseas modificar. ```python import requests url = "https://api.holded.com/api/v2/products/{productId}" headers = { "Authorization": "Bearer YOUR_API_KEY", "Accept": "application/json", } payload = { "name": "string", "description": "string", "sku": "string", "barcode": "string", "price": "49.99", "cost": "29.99", "tags": [ "string" ], "taxes": [ "string" ] } response = requests.put(url, headers=headers, json=payload) print(response.json()) ``` -------------------------------- ### Get Proforma Source: https://www.holded.com/es/desarrolladores/referencia-api/proformas Retrieves details of a specific proforma. ```APIDOC ## GET /api/v2/proformas/{proformaId} ### Description Retrieves details of a specific proforma. ### Method GET ### Endpoint /api/v2/proformas/{proformaId} ### Parameters #### Path Parameters - **proformaId** (string) - Required - The ID of the proforma to retrieve. ``` -------------------------------- ### Get Budget Source: https://www.holded.com/es/desarrolladores/referencia-api/presupuestos Retrieves details of a specific budget. ```APIDOC ## GET /api/v2/estimates/{estimateId} ### Description Retrieves details of a specific budget. ### Method GET ### Endpoint /api/v2/estimates/{estimateId} ### Parameters #### Path Parameters - **estimateId** (string) - Required - The ID of the budget to retrieve. ``` -------------------------------- ### Obtener lista de cuentas contables Source: https://www.holded.com/es/desarrolladores/referencia-api/contabilidad/listado-del-plan-contable Realiza una petición GET para obtener la lista de cuentas contables. Puedes filtrar por cuentas archivadas, rango de fechas y si se deben incluir cuentas sin transacciones. ```python import requests url = "https://api.holded.com/api/v2/accounting-accounts?archived=value&start_date=2024-01-01&end_date=2024-12-31" headers = { "Authorization": "Bearer YOUR_API_KEY", "Accept": "application/json", } response = requests.get(url, headers=headers) print(response.json()) ``` ```json { "items": [ { "id": "507f1f77bcf86cd799439011", "color": "#FF5733", "number": 4300, "name": "string", "group": "string", "debit": "1500.00", "credit": "500.00", "balance": "1000.00" } ] } ``` -------------------------------- ### Get Waybill Source: https://www.holded.com/es/desarrolladores/referencia-api/albaranes Retrieves details of a specific waybill. ```APIDOC ## GET /api/v2/waybills/{waybillId} ### Description Retrieves details of a specific waybill. ### Method GET ### Endpoint /api/v2/waybills/{waybillId} #### Path Parameters - **waybillId** (string) - Required - The ID of the waybill to retrieve. ``` -------------------------------- ### Actualizar un servicio con Python Source: https://www.holded.com/es/desarrolladores/referencia-api/servicios/actualizar-un-servicio Utiliza este snippet para enviar una petición PUT a la API de Holded y actualizar un servicio existente. Asegúrate de reemplazar 'YOUR_API_KEY' con tu clave de API real y proporciona los detalles del servicio en el payload. ```python import requests url = "https://api.holded.com/api/v2/services/{serviceId}" headers = { "Authorization": "Bearer YOUR_API_KEY", "Accept": "application/json", } payload = { "name": "Consulting", "description": "Consulting service", "price": 100, "cost": 50, "tax": 21, "taxes": [ "string" ], "tags": [ "string" ], "sales_channel_id": "string" } response = requests.put(url, headers=headers, json=payload) print(response.json()) ``` -------------------------------- ### Get Proforma Attachment Source: https://www.holded.com/es/desarrolladores/referencia-api/proformas Retrieves a specific attachment of a proforma. ```APIDOC ## GET /api/v2/proformas/{proformaId}/attachments/{attachmentId} ### Description Retrieves a specific attachment of a proforma. ### Method GET ### Endpoint /api/v2/proformas/{proformaId}/attachments/{attachmentId} ### Parameters #### Path Parameters - **proformaId** (string) - Required - The ID of the proforma. - **attachmentId** (string) - Required - The ID of the attachment. ``` -------------------------------- ### Actualizar un pago con Python Source: https://www.holded.com/es/desarrolladores/referencia-api/pagos/actualizar-un-pago Utiliza este snippet para actualizar un pago existente. Asegúrate de reemplazar 'YOUR_API_KEY' con tu clave de API real y '{paymentId}' con el ID del pago que deseas actualizar. El cuerpo de la petición incluye campos como amount, date, bank_account_id, contact_id y description. ```python import requests url = "https://api.holded.com/api/v2/payments/{paymentId}" headers = { "Authorization": "Bearer YOUR_API_KEY", "Accept": "application/json", } payload = { "amount": "1500.50", "date": 1526979494, "bank_account_id": "string", "contact_id": "string", "description": "string" } response = requests.put(url, headers=headers, json=payload) print(response.json()) ``` -------------------------------- ### Get Project by ID Source: https://www.holded.com/es/desarrolladores/referencia-api/proyectos Retrieves a specific project by its ID. ```APIDOC ## GET /api/v2/projects/{projectId} ### Description Retrieves a specific project by its ID. ### Method GET ### Endpoint `/api/v2/projects/{projectId}` #### Path Parameters - **projectId** (string) - Required - The ID of the project to retrieve. ``` -------------------------------- ### Adjuntar archivo a pedido de compra (Python) Source: https://www.holded.com/es/desarrolladores/referencia-api/pedidos-de-compra/adjuntar-un-archivo-a-un-pedido-de-compra Utiliza la biblioteca requests para enviar un archivo a un pedido de compra específico. Asegúrate de reemplazar YOUR_API_KEY con tu clave de API real y 'file.pdf' con la ruta a tu archivo. ```python import requests url = "https://api.holded.com/api/v2/purchase-orders/{purchaseOrderId}/attachments" headers = { "Authorization": "Bearer YOUR_API_KEY", } files = {"file": open("file.pdf", "rb")} response = requests.post(url, headers=headers, files=files) print(response.json()) ``` -------------------------------- ### Adjuntar archivo a presupuesto (Python) Source: https://www.holded.com/es/desarrolladores/referencia-api/presupuestos/adjuntar-un-archivo-a-un-presupuesto Utiliza la librería requests de Python para adjuntar un archivo a un presupuesto. Asegúrate de reemplazar 'YOUR_API_KEY' con tu clave de API real y 'estimateId' con el ID del presupuesto. ```python import requests url = "https://api.holded.com/api/v2/estimates/{estimateId}/attachments" headers = { "Authorization": "Bearer YOUR_API_KEY", } files = {"file": open("file.pdf", "rb")} response = requests.post(url, headers=headers, files=files) print(response.json()) ``` -------------------------------- ### Get Budget PDF Source: https://www.holded.com/es/desarrolladores/referencia-api/presupuestos Retrieves the PDF version of a budget. ```APIDOC ## GET /api/v2/estimates/{estimateId}/pdf ### Description Retrieves the PDF version of a budget. ### Method GET ### Endpoint /api/v2/estimates/{estimateId}/pdf ### Parameters #### Path Parameters - **estimateId** (string) - Required - The ID of the budget. ``` -------------------------------- ### Listar imágenes de un producto (Python) Source: https://www.holded.com/es/desarrolladores/referencia-api/productos/listar-imagenes-de-un-producto Realiza una petición GET al endpoint de la API para obtener las imágenes de un producto. Asegúrate de reemplazar `YOUR_API_KEY` con tu clave de API y `{productId}` con el ID del producto. ```python import requests url = "https://api.holded.com/api/v2/products/{productId}/images" headers = { "Authorization": "Bearer YOUR_API_KEY", "Accept": "application/json", } response = requests.get(url, headers=headers) print(response.json()) ``` -------------------------------- ### Get Budget Attachment Source: https://www.holded.com/es/desarrolladores/referencia-api/presupuestos Retrieves a specific attachment for a budget. ```APIDOC ## GET /api/v2/estimates/{estimateId}/attachments/{attachmentId} ### Description Retrieves a specific attachment for a budget. ### Method GET ### Endpoint /api/v2/estimates/{estimateId}/attachments/{attachmentId} ### Parameters #### Path Parameters - **estimateId** (string) - Required - The ID of the budget. - **attachmentId** (string) - Required - The ID of the attachment. ``` -------------------------------- ### Listar documentos entrantes con filtros Source: https://www.holded.com/es/desarrolladores/referencia-api/bandeja-de-entrada/listado-de-documentos-entrantes Realiza una petición GET para obtener documentos entrantes. Incluye parámetros de consulta como cursor, límite, estado, fechas y IDs de usuario. Asegúrate de incluir tu clave API en la cabecera de autorización. ```python import requests url = "https://api.holded.com/api/v2/inbox?cursor=value&limit=50&status=value" headers = { "Authorization": "Bearer YOUR_API_KEY", "Accept": "application/json", } response = requests.get(url, headers=headers) print(response.json()) ``` -------------------------------- ### Get Event by ID Source: https://www.holded.com/es/desarrolladores/referencia-api/eventos Retrieves a specific event by its ID. ```APIDOC ## GET /api/v2/events/{eventId} ### Description Retrieves a specific event by its ID. ### Method GET ### Endpoint /api/v2/events/{eventId} #### Path Parameters - **eventId** (string) - Required - The ID of the event to retrieve. ``` -------------------------------- ### Actualizar etapa del pipeline de presupuesto Source: https://www.holded.com/es/desarrolladores/referencia-api/presupuestos/establecer-pipeline-de-presupuesto Utiliza este endpoint para mover un presupuesto a una etapa específica del pipeline. Asegúrate de incluir tu clave API en las cabeceras y el ID del presupuesto y la etapa del pipeline en el cuerpo de la petición. ```python import requests url = "https://api.holded.com/api/v2/estimates/{estimateId}/pipeline" headers = { "Authorization": "Bearer YOUR_API_KEY", "Accept": "application/json", } payload = { "pipeline_id": "string" } response = requests.put(url, headers=headers, json=payload) print(response.json()) ``` ```typescript import fetch from 'node-fetch'; const estimateId = 'string'; const pipelineId = 'string'; fetch(`https://api.holded.com/api/v2/estimates/${estimateId}/pipeline`, { method: 'PUT', headers: { 'Authorization': 'Bearer YOUR_API_KEY', 'Accept': 'application/json', 'Content-Type': 'application/json' }, body: JSON.stringify({ pipeline_id: pipelineId }) }) .then(response => response.json()) .then(data => console.log(data)) .catch(error => console.error('Error:', error)); ``` ```javascript fetch('https://api.holded.com/api/v2/estimates/{estimateId}/pipeline', { method: 'PUT', headers: { 'Authorization': 'Bearer YOUR_API_KEY', 'Accept': 'application/json', 'Content-Type': 'application/json' }, body: JSON.stringify({ pipeline_id: 'string' }) }) .then(response => response.json()) .then(data => console.log(data)) .catch(error => console.error('Error:', error)); ``` ```go package main import ( "bytes" "encoding/json" "fmt" "net/http" ) func main() { url := "https://api.holded.com/api/v2/estimates/{estimateId}/pipeline" headers := map[string]string{ "Authorization": "Bearer YOUR_API_KEY", "Accept": "application/json", "Content-Type": "application/json", } payload := map[string]string{ "pipeline_id": "string", } payloadBytes, err := json.Marshal(payload) if err != nil { fmt.Println("Error marshaling payload:", err) return } req, err := http.NewRequest("PUT", url, bytes.NewBuffer(payloadBytes)) if err != nil { fmt.Println("Error creating request:", err) return } for key, value := range headers { req.Header.Set(key, value) } client := &http.Client{} res, err := client.Do(req) if err != nil { fmt.Println("Error sending request:", err) return } defer res.Body.Close() var result map[string]interface{} if err := json.NewDecoder(res.Body).Decode(&result); err != nil { fmt.Println("Error decoding response:", err) return } fmt.Println(result) } ``` ```ruby require 'net/http' require 'uri' require 'json' uri = URI.parse("https://api.holded.com/api/v2/estimates/{estimateId}/pipeline") request = Net::HTTP::Put.new(uri.request_uri) request['Authorization'] = "Bearer YOUR_API_KEY" request['Accept'] = "application/json" request['Content-Type'] = "application/json" payload = { "pipeline_id": "string" }.to_json request.body = payload response = Net::HTTP.start(uri.host, uri.port, :use_ssl => uri.scheme == 'https') do |http| http.request(request) end puts JSON.parse(response.body) ``` ```php "https://api.holded.com/api/v2/estimates/{estimateId}/pipeline", CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => "", CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 30, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => "PUT", CURLOPT_POSTFIELDS => json_encode([ "pipeline_id" => "string" ]), CURLOPT_HTTPHEADER => [ "Authorization: Bearer YOUR_API_KEY", "Accept: application/json", "Content-Type: application/json" ], ]); $response = curl_exec($curl); $err = curl_error($curl); curl_close($curl); if ($err) { echo "cURL Error #" . $err; } else { echo $response; } ``` ```curl curl --request PUT \ --url 'https://api.holded.com/api/v2/estimates/{estimateId}/pipeline' \ --header 'Authorization: Bearer YOUR_API_KEY' \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --data-raw '{ "pipeline_id": "string" }' ``` -------------------------------- ### Get Purchase Source: https://www.holded.com/es/desarrolladores/referencia-api/compras Retrieves details of a specific purchase order. ```APIDOC ## GET /api/v2/purchases/{purchaseId} ### Description Retrieves details of a specific purchase order. ### Method GET ### Endpoint /api/v2/purchases/{purchaseId} ### Parameters #### Path Parameters - **purchaseId** (string) - Required - The ID of the purchase order to retrieve. ``` -------------------------------- ### Get Waybill PDF Source: https://www.holded.com/es/desarrolladores/referencia-api/albaranes Retrieves the PDF version of a waybill. ```APIDOC ## GET /api/v2/waybills/{waybillId}/pdf ### Description Retrieves the PDF version of a waybill. ### Method GET ### Endpoint /api/v2/waybills/{waybillId}/pdf #### Path Parameters - **waybillId** (string) - Required - The ID of the waybill for which to get the PDF. ``` -------------------------------- ### Create Project Source: https://www.holded.com/es/desarrolladores/referencia-api/proyectos Creates a new project. ```APIDOC ## POST /api/v2/projects ### Description Creates a new project. ### Method POST ### Endpoint `/api/v2/projects` ``` -------------------------------- ### Get Waybill Attachment Source: https://www.holded.com/es/desarrolladores/referencia-api/albaranes Retrieves a specific attachment of a waybill. ```APIDOC ## GET /api/v2/waybills/{waybillId}/attachments/{attachmentId} ### Description Retrieves a specific attachment of a waybill. ### Method GET ### Endpoint /api/v2/waybills/{waybillId}/attachments/{attachmentId} #### Path Parameters - **waybillId** (string) - Required - The ID of the waybill. - **attachmentId** (string) - Required - The ID of the attachment. ``` -------------------------------- ### Actualizar un presupuesto existente Source: https://www.holded.com/es/desarrolladores/referencia-api/presupuestos/actualizar-un-presupuesto Utiliza este endpoint para reemplazar completamente un presupuesto con nuevos datos. Asegúrate de incluir todos los campos editables que deseas mantener. ```python import requests url = "https://api.holded.com/api/v2/estimates/{estimateId}" headers = { "Authorization": "Bearer YOUR_API_KEY", "Accept": "application/json", } payload = { "date": "2026-01-15", "due_date": "2026-01-31", "project_id": "string" } response = requests.put(url, headers=headers, json=payload) print(response.json()) ``` ```typescript import fetch from 'node-fetch'; const estimateId = "{estimateId}"; const url = `https://api.holded.com/api/v2/estimates/${estimateId}`; const headers = { "Authorization": "Bearer YOUR_API_KEY", "Accept": "application/json", "Content-Type": "application/json" }; const payload = { "date": "2026-01-15", "due_date": "2026-01-31", "project_id": "string" }; fetch(url, { method: 'PUT', headers: headers, body: JSON.stringify(payload) }) .then(response => response.json()) .then(data => console.log(data)) .catch(error => console.error('Error:', error)); ``` ```javascript const estimateId = "{estimateId}"; const url = `https://api.holded.com/api/v2/estimates/${estimateId}`; const headers = { "Authorization": "Bearer YOUR_API_KEY", "Accept": "application/json", "Content-Type": "application/json" }; const payload = { "date": "2026-01-15", "due_date": "2026-01-31", "project_id": "string" }; fetch(url, { method: 'PUT', headers: headers, body: JSON.stringify(payload) }) .then(response => response.json()) .then(data => console.log(data)) .catch(error => console.error('Error:', error)); ``` ```go package main import ( "bytes" "encoding/json" "fmt" "net/http" ) func main() { estimateID := "{estimateId}" url := fmt.Sprintf("https://api.holded.com/api/v2/estimates/%s", estimateID) headers := map[string]string{ "Authorization": "Bearer YOUR_API_KEY", "Accept": "application/json", "Content-Type": "application/json", } payload := map[string]interface{}{ "date": "2026-01-15", "due_date": "2026-01-31", "project_id": "string", } payloadBytes, err := json.Marshal(payload) if err != nil { fmt.Println("Error marshaling payload:", err) return } req, err := http.NewRequest("PUT", url, bytes.NewBuffer(payloadBytes)) if err != nil { fmt.Println("Error creating request:", err) return } for key, value := range headers { req.Header.Set(key, value) } client := &http.Client{} resp, err := client.Do(req) if err != nil { fmt.Println("Error sending request:", err) return } defer resp.Body.Close() var result map[string]interface{} err = json.NewDecoder(resp.Body).Decode(&result) if err != nil { fmt.Println("Error decoding response:", err) return } fmt.Println(result) } ``` ```ruby require 'net/http' require 'uri' require 'json' estimate_id = "{estimateId}" uri = URI.parse("https://api.holded.com/api/v2/estimates/#{estimate_id}") request = Net::HTTP::Put.new(uri) request["Authorization"] = "Bearer YOUR_API_KEY" request["Accept"] = "application/json" request["Content-Type"] = "application/json" payload = { "date": "2026-01-15", "due_date": "2026-01-31", "project_id": "string" } request.body = payload.to_json response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == 'https') do |http| http.request(request) end puts JSON.parse(response.body) ``` ```php "2026-01-15", "due_date" => "2026-01-31", "project_id" => "string", ]; $ch = curl_init($url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "PUT"); curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($payload)); $response = curl_exec($ch); if (curl_errno($ch)) { echo 'Error:' . curl_error($ch); } else { echo $response; } curl_close($ch); ?> ``` ```curl curl -X PUT \ 'https://api.holded.com/api/v2/estimates/{estimateId}' \ -H 'Authorization: Bearer YOUR_API_KEY' \ -H 'Accept: application/json' \ -H 'Content-Type: application/json' \ -d '{ "date": "2026-01-15", "due_date": "2026-01-31", "project_id": "string" }' ``` -------------------------------- ### Get Products Source: https://www.holded.com/es/desarrolladores Retrieves a list of products. Supports pagination. ```APIDOC ## GET /api/v2/products ### Description Retrieves a list of products. Supports pagination. ### Method GET ### Endpoint /api/v2/products ### Parameters #### Query Parameters - **cursor** (string) - Optional - The cursor for pagination. ### Response #### Success Response (200) - **data** (array) - List of products. - **pageInfo** (object) - Pagination information. ``` -------------------------------- ### Obtener adjunto de presupuesto con Python Source: https://www.holded.com/es/desarrolladores/referencia-api/presupuestos/obtener-adjunto-de-presupuesto Utiliza esta petición para descargar un archivo adjunto de un presupuesto. Asegúrate de reemplazar `YOUR_API_KEY` con tu clave de API real. ```python import requests url = "https://api.holded.com/api/v2/estimates/{estimateId}/attachments/{attachmentId}" headers = { "Authorization": "Bearer YOUR_API_KEY", "Accept": "application/json", } response = requests.get(url, headers=headers) print(response.json()) ``` -------------------------------- ### Get Invoices Source: https://www.holded.com/es/desarrolladores Retrieves a list of invoices. Supports pagination. ```APIDOC ## GET /api/v2/invoices ### Description Retrieves a list of invoices. Supports pagination. ### Method GET ### Endpoint /api/v2/invoices ### Parameters #### Query Parameters - **cursor** (string) - Optional - The cursor for pagination. ### Response #### Success Response (200) - **data** (array) - List of invoices. - **pageInfo** (object) - Pagination information. ``` -------------------------------- ### Actualizar una compra con Python Source: https://www.holded.com/es/desarrolladores/referencia-api/compras/actualizar-una-compra Utiliza este snippet para enviar una solicitud PUT a la API de Holded y actualizar una compra. Asegúrate de reemplazar `YOUR_API_KEY` con tu clave de API real y `purchaseId` con el ID de la compra que deseas modificar. ```python import requests url = "https://api.holded.com/api/v2/purchases/{purchaseId}" headers = { "Authorization": "Bearer YOUR_API_KEY", "Accept": "application/json", } payload = { "date": "2026-01-15", "due_date": "2026-01-31", "project_id": "string" } response = requests.put(url, headers=headers, json=payload) print(response.json()) ``` -------------------------------- ### Obtener la imagen principal de un producto Source: https://www.holded.com/es/desarrolladores/referencia-api/productos/obtener-la-imagen-principal-de-un-producto Recupera la imagen principal de un producto. Devuelve 404 si el producto no tiene imágenes. ```APIDOC ## GET /products/{productId}/image ### Description Retrieves the main (first) image of a product. Returns 404 if the product has no images. ### Method GET ### Endpoint `https://api.holded.com/api/v2/products/{productId}/image` ### Parameters #### Path Parameters - **productId** (string) - Required - ID del producto (ObjectId hexadecimal de 24 caracteres) ### Response #### Success Response (200) - **id** (string) - Required - Unique identifier of the image - **position** (integer) - Required - Position of the image in the product gallery (1-indexed) - **description** (string | null) - Required - Alt text or description of the image - **url** (string | null) - Required - Primary image URL (original size or raw URL) - **sizes** (object) - Required - Available image sizes with URLs and dimensions - **original** (object | null) - **large** (object | null) - **medium** (object | null) - **small** (object | null) - **thumbnail** (object | null) #### Response Example ```json { "id": "507f1f77bcf86cd799439011", "position": 1, "description": "string", "url": "string", "sizes": { "original": { "url": "string", "width": 0, "height": 0 }, "large": { "url": "string", "width": 0, "height": 0 }, "medium": { "url": "string", "width": 0, "height": 0 }, "small": { "url": "string", "width": 0, "height": 0 }, "thumbnail": { "url": "string", "width": 0, "height": 0 } } } ``` #### Error Responses - **401** - API key inválida o no proporcionada - **403** - Permisos insuficientes - **404** - Producto no encontrado o sin imágenes - **429** - Límite de solicitudes excedido ``` -------------------------------- ### Start Employee Break Source: https://www.holded.com/es/desarrolladores/referencia-api/control-horario-de-empleados Initiates a break period for an employee. ```APIDOC ## Start Employee Break ### Description Initiates a break period for an employee. ### Method POST ### Endpoint `/api/v2/employees/{employeeId}/pause` ### Parameters #### Path Parameters - **employeeId** (string) - Required - The ID of the employee to start a break. ```