Groups

All endpoints related to Groups

Supported Endpoints

  • getAllGroups(): Returns a list of all the groups created.

  • getGroup(id): Retrieves a group by the entered ID.

  • createGroup(type, data, description): Creates a group and returns the created group.

  • updateGroup(id, type, data, description): Updates a group by the entered ID.

  • deleteGroup(id): Deletes a group by the entered ID.

  • addProductToGroup(id): Add a product to a group.

  • removeProductInGroup(id): Remove a product from a group.

  • getProductInGroup(id): Get product in a group.


getAllGroups()

Usage
const Sellapp = require("sellapp-node");
const API = new Sellapp.API("YOUR_API_KEY");

API.groups.getAllGroups().then((res) => {
    console.log(res)
});

getGroup()

Type
Required
Description

id

string

✔️

ID of a group

Usage
const Sellapp = require("sellapp-node");
const API = new Sellapp.API("YOUR_API_KEY");

API.groups.getGroup("666").then((res) => {
    console.log(res)
})


createGroup()

Parameters
Type
Required
Description

id

string

✔️

ID of a group

title

string

✔️

The group title.

order

integer

✔️

The order rank of the group.

unlisted

boolean

✔️

Whether the group is unlisted or not. If set to true, the group will only be accessible via a direct link.

image

object/null

The image belonging to the group.

section_id

integer/null

The ID of the section this group belongs to.

section_order

integer/null

The order rank of the group within the section it belongs to.

Usage
const Sellapp = require("sellapp-node");
const API = new Sellapp.API("YOUR_API_KEY");

API.groups.createGroup({
    "title":"Rat race",
    "order":1,
    "unlisted":false
}).then((res) => {
    console.log(res);
});

updateGroup()

Parameters
Type
Required
Description

id

string

✔️

ID of a group

title

string

The group title.

order

integer

The order rank of the group.

unlisted

boolean

Whether the group is unlisted or not. If set to true, the group will only be accessible via a direct link.

image

object/null

The image belonging to the group.

section_id

integer/null

The ID of the section this group belongs to.

section_order

integer/null

The order rank of the group within the section it belongs to.

Usage
const Sellapp = require("sellapp-node");
const API = new Sellapp.API("YOUR_API_KEY");

API.groups.updateGroup("666", {
    "title":"Rat race",
    "order": 1,
    "unlisted": true
}).then((res) => {
    console.log(res); 
});

deleteGroup()

Parameters
Type
Required
Description

id

string

✔️

ID of a Group

Usage
const Sellapp = require("sellapp-node");
const API = new Sellapp.API("YOUR_API_KEY");

API.groups.deleteGroup("666").then((res) => {
    console.log(res)
})

Last updated