Skip to main content
PUT
/
brands
/
{brandId}
Put a brand.
curl --request PUT \
  --url https://api.aasaan.shop/api/v1/stores/brands/{brandId} \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "Head & Shoulders",
  "image": {
    "id": 0,
    "url": "https://images.aasaan.app/123412421",
    "type": "image/png"
  },
  "slug": "head_shoulders",
  "description": "Head & Shoulders",
  "hide": false,
  "displayOrder": 0,
  "active": "true"
}
'
import requests

url = "https://api.aasaan.shop/api/v1/stores/brands/{brandId}"

payload = {
"name": "Head & Shoulders",
"image": {
"id": 0,
"url": "https://images.aasaan.app/123412421",
"type": "image/png"
},
"slug": "head_shoulders",
"description": "Head & Shoulders",
"hide": False,
"displayOrder": 0,
"active": "true"
}
headers = {"Content-Type": "application/json"}

response = requests.put(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'PUT',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Head & Shoulders',
image: {id: 0, url: 'https://images.aasaan.app/123412421', type: 'image/png'},
slug: 'head_shoulders',
description: 'Head & Shoulders',
hide: false,
displayOrder: 0,
active: 'true'
})
};

fetch('https://api.aasaan.shop/api/v1/stores/brands/{brandId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://api.aasaan.shop/api/v1/stores/brands/{brandId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'Head & Shoulders',
'image' => [
'id' => 0,
'url' => 'https://images.aasaan.app/123412421',
'type' => 'image/png'
],
'slug' => 'head_shoulders',
'description' => 'Head & Shoulders',
'hide' => false,
'displayOrder' => 0,
'active' => 'true'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"strings"
"net/http"
"io"
)

func main() {

url := "https://api.aasaan.shop/api/v1/stores/brands/{brandId}"

payload := strings.NewReader("{\n \"name\": \"Head & Shoulders\",\n \"image\": {\n \"id\": 0,\n \"url\": \"https://images.aasaan.app/123412421\",\n \"type\": \"image/png\"\n },\n \"slug\": \"head_shoulders\",\n \"description\": \"Head & Shoulders\",\n \"hide\": false,\n \"displayOrder\": 0,\n \"active\": \"true\"\n}")

req, _ := http.NewRequest("PUT", url, payload)

req.Header.Add("Content-Type", "application/json")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.put("https://api.aasaan.shop/api/v1/stores/brands/{brandId}")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Head & Shoulders\",\n \"image\": {\n \"id\": 0,\n \"url\": \"https://images.aasaan.app/123412421\",\n \"type\": \"image/png\"\n },\n \"slug\": \"head_shoulders\",\n \"description\": \"Head & Shoulders\",\n \"hide\": false,\n \"displayOrder\": 0,\n \"active\": \"true\"\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.aasaan.shop/api/v1/stores/brands/{brandId}")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Put.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Head & Shoulders\",\n \"image\": {\n \"id\": 0,\n \"url\": \"https://images.aasaan.app/123412421\",\n \"type\": \"image/png\"\n },\n \"slug\": \"head_shoulders\",\n \"description\": \"Head & Shoulders\",\n \"hide\": false,\n \"displayOrder\": 0,\n \"active\": \"true\"\n}"

response = http.request(request)
puts response.read_body
{
  "id": "623d3455ec3c4b3548eb4a322",
  "name": "Head & Shoulders",
  "slug": "head_shoulders",
  "description": "Head & Shoulders",
  "hide": false,
  "displayOrder": 0,
  "active": "true",
  "image": {
    "id": 0,
    "url": "https://images.aasaan.app/123412421",
    "type": "image/png"
  },
  "date_created": "2022-03-25T03:17:44.092Z",
  "date_modified": "2022-06-10T07:51:12.510Z"
}

Path Parameters

brandId
string
required

Brand id

Body

application/json
name
string
required

Name

Example:

"Head & Shoulders"

image
object
required

Brand image

slug
string

Slug

Example:

"head_shoulders"

description
string

Head & Shoulders brand

Example:

"Head & Shoulders"

hide
boolean

Hide a brand

Example:

false

displayOrder
string

Display order

Example:

0

active
boolean

Activate the brand

Example:

"true"

Response

Brand created.

id
string

Unique identifier for the resource

Example:

"623d3455ec3c4b3548eb4a322"

name
string

Name

Example:

"Head & Shoulders"

slug
string

Slug

Example:

"head_shoulders"

description
string

Head & Shoulders brand

Example:

"Head & Shoulders"

hide
boolean

Hide a brand

Example:

false

displayOrder
string

Display order

Example:

0

active
boolean

Activate the brand

Example:

"true"

image
object

Brand image

date_created
string

Created date

Example:

"2022-03-25T03:17:44.092Z"

date_modified
string

Modified date

Example:

"2022-06-10T07:51:12.510Z"