Skip to main content

Create a product or service

POSThttps://carchost.fieldcontrol.com.br/products-services

Creates a product or a service, according to type. In accounts with the inventory control module, a product can be created already with a balance in the storages (storageProducts).

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

Request​

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

  • 201

    Product or service 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).

  • 429

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

  • 500

    Unexpected server error. It also happens when type is neither product nor service.