Create a part
https://carchost.fieldcontrol.com.br/partsCreates a part, already with the equipment types it can be installed in and the custom fields.
Requires the
X-Api-Key,User-AgentandContent-Type: application/jsonheaders. Limit: 1 request per second (learn more).
Request
Headers
User-AgentstringrequiredIdentification of your application.
Example: MinhaIntegracao/1.0.
Request body
JSON, sent with the Content-Type: application/json header.
namestringrequiredPart name. Must be unique in the account.
codestringrequiredPart code. Must be unique in the account.
partTypeIdstringrequiredPart type identifier.
descriptionstringPart description.
imageUrlstringURL of the part image.
usageConditionstringUsage condition.
Accepted values: new, semi_new, used, refurbished, defective.Default: new.
valuenumberUnit price.
externalIdstringPart identifier in your system.
archivedbooleanArchives the part.
minimalQuantitynumberMinimum quantity in storage. Cannot be negative.
minimalQuantityAtRisknumberQuantity from which the stock is considered at risk. Cannot be negative.
equipmentTypeIdslist of stringIdentifiers of the equipment types the part can be installed in. Only considered on creation.
customFieldslist of objectsCustom fields. When sent, it replaces all current fields.
Fields of customFields
namestringField name.
valuestringField value.
typestringrequiredField type. Missing or outside this list results in a 500 error and nothing is stored.
Accepted values: question, multiple-choice, date, number.
positionintegerDisplay position. Defaults to the order in the array, starting at 1.
Responses
- 201
Part created.
- 401
API key missing (
Missing API Key) or invalid (Invalid API Key). See Authentication. - 403
Account blocked (
Account blocked), expired (Account expired) or on a plan that does not allow integration (Account plan not allowed). See Authentication. - 422
Invalid body (resourceValidationErr):
name,codeorpartTypeIdmissing (reason: missing required field),nameorcodealready used in the account (reason: duplicate), nonexistent part type or invalidusageCondition. - 429
Limit of 1 request per second exceeded. See Rate limit.
- 500
Unexpected server error.