Add store department
using System.Net.Http.Headers;var client = new HttpClient();var request = new HttpRequestMessage{ Method = HttpMethod.Post, RequestUri = new Uri("https://api.diller.app/api/v2.0/stores/your-store-id/departments"), Headers = { { "Authorization", "Bearer <token>" }, }, Content = new StringContent("{ \"id\": \"example\", \"name\": \"example\", \"origin\": { \"system_id\": \"example\", \"employee_id\": \"example\", \"department_id\": \"example\", \"department_name\": \"example\", \"channel\": \"example\" } }") { Headers = { ContentType = new MediaTypeHeaderValue("application/json") } }};using (var response = await client.SendAsync(request)){ response.EnsureSuccessStatusCode(); var body = await response.Content.ReadAsStringAsync(); Console.WriteLine(body);}package main
import ( "fmt" "strings" "net/http" "io")
func main() {
url := "https://api.diller.app/api/v2.0/stores/your-store-id/departments"
payload := strings.NewReader("{ \"id\": \"example\", \"name\": \"example\", \"origin\": { \"system_id\": \"example\", \"employee_id\": \"example\", \"department_id\": \"example\", \"department_name\": \"example\", \"channel\": \"example\" } }")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>") req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close() body, _ := io.ReadAll(res.Body)
fmt.Println(res) fmt.Println(string(body))
}OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");RequestBody body = RequestBody.create(mediaType, "{ \"id\": \"example\", \"name\": \"example\", \"origin\": { \"system_id\": \"example\", \"employee_id\": \"example\", \"department_id\": \"example\", \"department_name\": \"example\", \"channel\": \"example\" } }");Request request = new Request.Builder() .url("https://api.diller.app/api/v2.0/stores/your-store-id/departments") .post(body) .addHeader("Authorization", "Bearer <token>") .addHeader("Content-Type", "application/json") .build();
Response response = client.newCall(request).execute();import axios from 'axios';
const options = { method: 'POST', url: 'https://api.diller.app/api/v2.0/stores/your-store-id/departments', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, data: { id: 'example', name: 'example', origin: { system_id: 'example', employee_id: 'example', department_id: 'example', department_name: 'example', channel: 'example' } }};
try { const { data } = await axios.request(options); console.log(data);} catch (error) { console.error(error);}const url = 'https://api.diller.app/api/v2.0/stores/your-store-id/departments';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"id":"example","name":"example","origin":{"system_id":"example","employee_id":"example","department_id":"example","department_name":"example","channel":"example"}}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.diller.app/api/v2.0/stores/your-store-id/departments \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "id": "example", "name": "example", "origin": { "system_id": "example", "employee_id": "example", "department_id": "example", "department_name": "example", "channel": "example" } }'Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”The store id
Example
your-store-idRequest Body
Section titled “Request Body”object
Represents the origin of the request, by department, employee, system id and channel. Eg. Employee John Doe at Pos number 10 in the store department “New York” submitted this request.
object
The id for of the operator that made the request (if applicable)
Represents the business channel through which the API call occurred. It accepts ‘POS’ for Point-of-Sale systems and ‘OnlineStore’ for online stores. When the channel is empty or not recognized, it defaults to ‘POS’.
Examplegenerated
{ "id": "example", "name": "example", "origin": { "system_id": "example", "employee_id": "example", "department_id": "example", "department_name": "example", "channel": "example" }}object
Represents the origin of the request, by department, employee, system id and channel. Eg. Employee John Doe at Pos number 10 in the store department “New York” submitted this request.
object
The id for of the operator that made the request (if applicable)
Represents the business channel through which the API call occurred. It accepts ‘POS’ for Point-of-Sale systems and ‘OnlineStore’ for online stores. When the channel is empty or not recognized, it defaults to ‘POS’.
Examplegenerated
{ "id": "example", "name": "example", "origin": { "system_id": "example", "employee_id": "example", "department_id": "example", "department_name": "example", "channel": "example" }}object
Represents the origin of the request, by department, employee, system id and channel. Eg. Employee John Doe at Pos number 10 in the store department “New York” submitted this request.
object
The id for of the operator that made the request (if applicable)
Represents the business channel through which the API call occurred. It accepts ‘POS’ for Point-of-Sale systems and ‘OnlineStore’ for online stores. When the channel is empty or not recognized, it defaults to ‘POS’.
Examplegenerated
{ "id": "example", "name": "example", "origin": { "system_id": "example", "employee_id": "example", "department_id": "example", "department_name": "example", "channel": "example" }}Responses
Section titled “Responses”OK
object
Examplegenerated
[ { "id": "example", "name": "example", "is_visible": true }]Bad Request
object
object
Examplegenerated
{ "type": "example", "title": "example", "status": 1, "detail": "example", "instance": "example", "errors": { "additionalProperty": [ "example" ] }}