Update Supplier
Updates the name of an existing supplier.
Rules:
- The
namefield is required and cannot be empty. - You cannot update to a name already used by another supplier in the same company.
Use this endpoint to fix typos or update a supplier's legal name.
curl -X PUT "https://api-sandbox.contasimples.com/suppliers/v1/suppliers/16" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-d '{
"name": "Updated Supplier LLC"
}'
import requests
import json
url = "https://api-sandbox.contasimples.com/suppliers/v1/suppliers/16"
headers = {
"Content-Type": "application/json",
"Authorization": "Bearer YOUR_API_TOKEN"
}
data = {
"name": "Updated Supplier LLC"
}
response = requests.put(url, headers=headers, json=data)
print(response.json())
const response = await fetch("https://api-sandbox.contasimples.com/suppliers/v1/suppliers/16", {
method: "PUT",
headers: {
"Content-Type": "application/json",
"Authorization": "Bearer YOUR_API_TOKEN"
},
body: JSON.stringify({
"name": "Updated Supplier LLC"
})
});
const data = await response.json();
console.log(data);
package main
import (
"fmt"
"net/http"
"bytes"
"encoding/json"
)
func main() {
data := []byte(`{
"name": "Updated Supplier LLC"
}`)
req, err := http.NewRequest("PUT", "https://api-sandbox.contasimples.com/suppliers/v1/suppliers/16", bytes.NewBuffer(data))
if err != nil {
panic(err)
}
req.Header.Set("Content-Type", "application/json")
req.Header.Set("Authorization", "Bearer YOUR_API_TOKEN")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
fmt.Println("Response Status:", resp.Status)
}
require 'net/http'
require 'json'
uri = URI('https://api-sandbox.contasimples.com/suppliers/v1/suppliers/16')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Put.new(uri)
request['Content-Type'] = 'application/json'
request['Authorization'] = 'Bearer YOUR_API_TOKEN'
request.body = '{
"name": "Updated Supplier LLC"
}'
response = http.request(request)
puts response.body
{
"id": 16,
"name": "Updated Supplier LLC",
"type": {
"id": 1,
"type": "CUSTOM"
}
}
{
"error": "Bad Request",
"message": "One or more request parameters are invalid.",
"code": 400,
"requestId": "123e4567-e89b-12d3-a456-426614174000",
"details": [
"The example field must have a value between 5 and 100.",
"Dates must be in YYYY-MM-DD format."
]
}
{
"error": "Unauthorized",
"message": "Invalid or expired access token.",
"requestId": "123e4567-e89b-12d3-a456-426614174000",
"code": 401
}
{
"error": "Not Found",
"message": "The requested resource was not found.",
"requestId": "123e4567-e89b-12d3-a456-426614174000",
"code": 404
}
{
"error": "Conflict",
"message": "A supplier with the same name already exists for this company.",
"requestId": "123e4567-e89b-12d3-a456-426614174000",
"code": 409
}
{
"error": "Internal Server Error",
"message": "An unexpected error occurred while processing the request.",
"requestId": "123e4567-e89b-12d3-a456-426614174000",
"code": 500
}
/suppliers/v1/suppliers/{id}Target server for requests. Edit to use your own host.
Bearer token from OAuth 2.0 client credentials. Format: Bearer {token}
Bearer {token}Numeric supplier identifier — use the id field returned by GET /suppliers/v1/suppliers.
The media type of the request body
New supplier name. Must be unique among your registered suppliers.
Request Preview
Response
Response will appear here after sending the request
Authentication
Bearer token. Bearer token from OAuth 2.0 client credentials. Format: Bearer {token}
Path Parameters
Numeric supplier identifier — use the id field returned by GET /suppliers/v1/suppliers.
16Body
New supplier name. Must be unique among your registered suppliers.
Updated Supplier LLCResponses
Numeric supplier identifier.
Always returns the ID of the authenticated company.
Supplier name.
Supplier type. Indicates whether created by your company (CUSTOM) or platform-seeded (DEFAULT).
Short error type (e.g. Bad Request, Not Found).
Brief error message for API clients.
HTTP status code for the error (matches the response status).
Optional. For 400 errors, may be a single string or an array of strings with each validation failure.
Short error type (e.g. Bad Request, Not Found).
Brief error message for API clients.
HTTP status code for the error (matches the response status).
Optional. For 400 errors, may be a single string or an array of strings with each validation failure.
Short error type (e.g. Bad Request, Not Found).
Brief error message for API clients.
HTTP status code for the error (matches the response status).
Optional. For 400 errors, may be a single string or an array of strings with each validation failure.
Short error type (e.g. Bad Request, Not Found).
Brief error message for API clients.
HTTP status code for the error (matches the response status).
Optional. For 400 errors, may be a single string or an array of strings with each validation failure.
Short error type (e.g. Bad Request, Not Found).
Brief error message for API clients.
HTTP status code for the error (matches the response status).
Optional. For 400 errors, may be a single string or an array of strings with each validation failure.