Update Data (PUT)

Updating Object Data with PUT Requests

The PUT method allows you to update existing objects in the system by sending your changes to a specific URL that references the object.

Important: PUT requests can only be used to update specific objects by their ID. You cannot update multiple objects in a single request (for example, you cannot update all products at once).

Request Format

To update an object, send a PUT HTTP request to the URL that refers to the specific object you want to modify. The data must be submitted as a JSON array of keys and values for the object fields.

Content-Type Required: The header Content-Type must be declared and set to application/json, otherwise the default text/plain is assumed and the request will fail.

Example Request

Update the name of the product with ID 1:

curl --user admin@example.com:APIkey --header 'Content-Type: application/json' -d '{"product": "New Product Name"}' -X PUT 'https://www.venddor.com.br/api/products/1'

Example Request Body

{
  "product": "New Product Name"
}

Response Format

After a successful update, the API will return the ID of the updated object:

{
  "product_id": "1"
}

Common HTTP Status Codes

Status Code Description
200 OK The object was updated successfully
400 Bad Request Invalid request format or parameters
401 Unauthorized Authentication required or failed
403 Forbidden You don't have permission to update this object
404 Not Found The requested object doesn't exist
Note: Refer to the API objects documentation for a complete list of supported fields for each object type.