Agregar/Actualizar artículo


La siguiente endpoint se puede utilizar para agregar o actualizar un elemento dentro de la aplicación {app.name}.


Punto Final

La siguiente endpoint se puede utilizar para agregar o actualizar un elemento. Debes reemplazar el site_id variable con el ID del sitio que se proporcionó cuando se creó el sitio.

POST
{base_url}/api/v4/site/{site_id}/item/addUpdate
Solicitud
Campo
Tipo
Requerido
Descripción
external_id
String
The unique item id from the source system/database. If we detect a record with the same `external_id`, it will be updated, otherwise it will be added.
name
String
El nombre del artículo.
description
String
La descripción del artículo.
unit_price
Number
El precio por unidad del artículo. Format = 0.00
active
Boolean
--
Esta bandera representa si el registro del artículo está activo y disponible para ser utilizado o no.
Default = `true`
Sample Request
			
				{
  "external_id": "439772921",
  "name": "Men's Large T-Shirt",
  "unit_price": 14.99,
  "active": true
}
			
		
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.
errors
String [ ]
A list of errors. Will only be returned if `success` is `false`.
Sample Response (Successful)
			
				{
  "success": true,
  "action": "added",
  "_id": "60f720d248f143332af022e0"
}
			
		
Sample Response (Failed)
			
				{
  "success": false,
  "errors": [
    "invalid field2",
    "missing field_name"
  ]
}