Update a seller
Updates a seller account. Requires an administrator JWT.
curl -X PUT "http://localhost:8080/api/sellers/123" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_TOKEN (JWT)" \
-d '{
"email": "user@example.com",
"password": "example_string",
"name": "John Doe",
"role": "ADMIN"
}'
import requests
import json
url = "http://localhost:8080/api/sellers/123"
headers = {
"Content-Type": "application/json",
"Authorization": "Bearer YOUR_API_TOKEN (JWT)"
}
data = {
"email": "user@example.com",
"password": "example_string",
"name": "John Doe",
"role": "ADMIN"
}
response = requests.put(url, headers=headers, json=data)
print(response.json())
const response = await fetch("http://localhost:8080/api/sellers/123", {
method: "PUT",
headers: {
"Content-Type": "application/json",
"Authorization": "Bearer YOUR_API_TOKEN (JWT)"
},
body: JSON.stringify({
"email": "user@example.com",
"password": "example_string",
"name": "John Doe",
"role": "ADMIN"
})
});
const data = await response.json();
console.log(data);
package main
import (
"fmt"
"net/http"
"bytes"
"encoding/json"
)
func main() {
data := []byte(`{
"email": "user@example.com",
"password": "example_string",
"name": "John Doe",
"role": "ADMIN"
}`)
req, err := http.NewRequest("PUT", "http://localhost:8080/api/sellers/123", bytes.NewBuffer(data))
if err != nil {
panic(err)
}
req.Header.Set("Content-Type", "application/json")
req.Header.Set("Authorization", "Bearer YOUR_API_TOKEN (JWT)")
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('http://localhost:8080/api/sellers/123')
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 (JWT)'
request.body = '{
"email": "user@example.com",
"password": "example_string",
"name": "John Doe",
"role": "ADMIN"
}'
response = http.request(request)
puts response.body
{
"id": 123,
"email": "user@example.com",
"name": "John Doe",
"role": "ADMIN"
}
{
"error": "Bad Request",
"message": "The request contains invalid parameters or malformed data",
"code": 400,
"details": [
{
"field": "email",
"message": "Invalid email format"
}
]
}
{
"error": "Unauthorized",
"message": "Authentication required. Please provide a valid API token",
"code": 401
}
{
"error": "Forbidden",
"message": "You don't have permission to access this resource",
"code": 403
}
{
"error": "Not Found",
"message": "The requested resource was not found",
"code": 404
}
/api/sellers/{id}Target server for requests. Edit to use your own host.
JWT access token, or refresh token for the token refresh endpoint.
Seller identifier.
The media type of the request body
Updated seller email address.
Updated seller password.
Updated seller display name.
Updated seller role.
Request Preview
Response
Response will appear here after sending the request
Authentication
Bearer token (JWT). JWT access token, or refresh token for the token refresh endpoint.
Path Parameters
Seller identifier.
Body
Updated seller email address.
Updated seller password.
Updated seller display name.
Responses
Seller identifier.
Seller email address.
Seller display name.
Seller role.
ADMINSELLER