Agregar/Actualizar artículo


The following endpoint can be used to add or update an item within the Hyfin application.


Punto Final

La siguiente endpoint se puede utilizar para agregar o actualizar un elemento. Debes reemplazar el {base_url} y {site_id} variables with your issued host and the site id that was provided when the site was created.

POST
{base_url}/api/v4/site/{site_id}/item/addUpdate
Solicitud
Campo
Tipo
Descripción
externalId
String
El identificador único del artículo del sistema/base de datos fuente. Si detectamos un registro con el mismo externalId, se actualizará; de lo contrario, se agregará.
name
String
El nombre del artículo.
description
String
La descripción del artículo.
unitPrice
Number
El precio por unidad del artículo. Este es un número entero de centavos, por lo que 1035 significa $10.35.
deleted
Boolean
Esta bandera representa si el registro ha sido eliminado y ya no está disponible para ser utilizado.
Sample Request
			
{
  "externalId": "439772921",
  "name": "Men's Large T-Shirt",
  "unitPrice": 1499,
  "deleted": false
}


		
Respuesta
Campo
Tipo
Descripción
success
Boolean
Whether the record was added or updated successfully.
action
String
Informs whether the record was added or updated. Will only be returned if success is true.
One of added, updated
_id
String
The auto generated id assigned to the record.
updatedAt
Date
The date the record was last updated.
errors
String [ ]
A list of errors. Will only be returned if success is false.
Sample Response (Successful)
			
{
  "success": true,
  "action": "added",
  "_id": "60f720d248f143332af022e0",
  "updatedAt": "2025-05-30T19:19:44.143Z"
}


		
Sample Response (Failed)
			
{
  "success": false,
  "errors": [
    "invalid field2",
    "missing field_name"
  ]
}