POST
Crear un magatzem
Scope:
inventory:warehouses.writehttps://api.holded.com/api/v2/warehousesCrea un nou magatzem en el teu compte.
Cos de la petició
object
namestringrequired
Nom del magatzem
emailstring | nulloptional
Adreça d'email del magatzem
phonestring | nulloptional
Número de telèfon del magatzem
mobilestring | nulloptional
Número de mòbil del magatzem
defaultbooleanoptional
Si aquest és el magatzem predeterminat
addressobject | nulloptional
Adreça del magatzem
addressstring | null
Carrer i número
citystring | null
Ciutat
provincestring | null
Província o estat
postal_codestring | null
Codi postal
countrystring | null
País
country_codestring | null
Codi de país ISO 3166-1 alpha-2
Petició
python
import requests
url = "https://api.holded.com/api/v2/warehouses"
headers = {
"Authorization": "Bearer YOUR_API_KEY",
"Accept": "application/json",
}
payload = {
"name": "string",
"email": "string",
"phone": "string",
"mobile": "string",
"default": false,
"address": {
"address": "string",
"city": "string",
"province": "string",
"postal_code": "string",
"country": "string",
"country_code": "string"
}
}
response = requests.post(url, headers=headers, json=payload)
print(response.json())Respostes
Resposta
json
{
"id": "507f1f77bcf86cd799439011"
}Respostes exitoses
201Magatzem creatapplication/jsonobject
idstring
Respostes d'error
400Sol·licitud incorrectaapplication/json401API key no vàlida o no proporcionadaapplication/json403Permisos insuficientsapplication/json422Error de validacióapplication/json429Límit de sol·licituds exceditapplication/json