Skip to main content

Update a product or service

PUThttps://carchost.fieldcontrol.com.br/products-services/{id}

Updates a product or service. Send the full record: the body follows the same rules as creation. storageProducts is ignored; the stock balance changes through movements.

Requires the X-Api-Key, User-Agent and Content-Type: application/json headers. Limit: 1 request per second (learn more).

Request​

Path parameters

idstringrequired

Product or service identifier.

Example: NmIzYWU1NGItN2IxNi00NzQ2LTg4ZmUtOGM2ZjY3YzlhOTMxOjIyOTE1.

Headers

User-Agentstringrequired

Identification of your application.

Example: MinhaIntegracao/1.0.

Request body

JSON, sent with the Content-Type: application/json header.

namestringrequired

Product or service name.

Up to 100 characters.

typestring or numberrequired

product or service. A number or any other text results in a 500 error.

Accepted values: product, service.

descriptionstring

Description.

Up to 2000 characters.

measurestringrequired

Unit of measure, also required for services. Values outside this list are stored as unity. kilogram is stored, but comes back as null in responses.

Accepted values: unity, centimeter, meter, liter, milliliter, kilogram.

valuenumberrequired

Unit price.

archivedbooleanrequired

Archives the product or service.

externalobject
Fields of external
idstring

Identifier in your system.

Up to 100 characters.Accepts: null.

storageProductslist of objects

Initial balance in each storage. Only considered when creating products (type: product) in accounts with the inventory control module: the API records one entry movement per item. Ignored on update.

Fields of storageProducts
storageobjectrequired
Fields of storage
idstringrequired

Storage identifier.

quantitynumberrequired

Entry quantity.

minimalQuantitynumber

Minimum quantity of the product in the storage.

Accepts: null.

minimalQuantityAtRisknumber

Quantity from which the stock is considered at risk.

Accepts: null.

Responses

  • 200

    Product or service updated.

  • 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 identifier, or one from another account, in the URL (uriValidationErr), nonexistent record (resourceValidationErr with message: product/service not found; there is no 404) or invalid body.

    resourceValidationErr →
  • 429

    Limit of 1 request per second exceeded. See Rate limit.

  • 500

    Unexpected server error.