Saltar al contingut principal
PUT

Actualitzar un servei

Scope:sales:services.write
https://api.holded.com/api/v2/services/{serviceId}

Substitueix tots els camps editables d'un servei existent. Es tracta d'una substitució completa del recurs.

Paràmetres

Paràmetres de ruta

serviceIdstringobligatori

ID del servei (ObjectId hexadecimal de 24 caràcters)

Cos de la petició

object
namestring

Nom del servei

descriptionstring | null

Descripció del servei

pricenumber

Preu de venda unitari

costnumber | null

Preu de cost unitari

taxnumber | null

Percentatge d'impost

taxes[]string[] | null

Llista d'identificadors d'impostos a aplicar

tags[]string[] | null

Llista d'etiquetes

sales_channel_idstring | null

Identificador del canal de venda

codestring | null

Codi de referència intern

colorstring | null

Codi de color hexadecimal per a la interfície

durationnumber | null

Durada en minuts

Petició

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",
    "code": "string",
    "color": "string",
    "duration": 0
}
response = requests.put(url, headers=headers, json=payload)
print(response.json())

Respostes

Resposta

json
{
  "id": "string"
}

Respostes exitoses

200Servei actualitzatapplication/json
object
idstring

Respostes d'error

400Sol·licitud incorrectaapplication/json
401API key no vàlida o no proporcionadaapplication/json
403Permisos insuficientsapplication/json
404Servei no trobatapplication/json
429Límit de sol·licituds exceditapplication/json