Division is a store which owns the brand. There are two types of division such as main and sub
The users of main divisions are able to perform actions for both their and its sub-divisions.
create, update, list, approve, cancel or reject quotation
create, list quotation comment
create order from a quotation
create, update, list, delete quotation discount
The users of sub-divisions are able to perform their quotations only.
create, list, approve, cancel or reject, approve pending quotation
A division has a monthly limit field. If this limit is exceeded, the division cannot create new quotations.
When the main division creates a new quotation, the total is calculated by adding the total amount of its quotations, the total amount of quotations from its sub-divisions, and the amount of the new quotation being created. If this cumulative total exceeds the main division's monthly limit, the new quotation cannot be created.
When a sub-division creates a new quotation, the total is calculated by adding the total amount of its quotations and the amount of the new quotation being created.
When a division is created country_id, city_id, township_id, district_id, phone_number, address should be matched with Commerce data otherwise exception occurs when creating an order.
This method allows users to retrieve a list of their divisions. Depending on the association, it retrieves either all child divisions linked to the main division or the associated division along with its parent division.
It occurs when the posted parent is not a main division:
{
"parent": [
"The type of division is not main."
]
}
Example Response (400 Bad Request)
It occurs when sending parent property with main division type:
{
"parent": [
"The main division can not have parent."
]
}
Deactivate Division
When a division is deactivated its users and Commerce users are deactivated as well. Users cannot perform actions when they are deactivated.
Example Request
curl --location --request POST '{host}/api/v1/divisions/2/deactivate/' \
--header 'Authorization: Token {Token}'
Example Response (200 OK)
Empty body.
Activate Division
When a division is activated its users are activated as well.
Example Request
curl --location --request POST '{host}/api/v1/divisions/2/activate/' \
--header 'Authorization: Token {Token}'
Example Response (200 OK)
Empty body.
Export My Divisions
Exports divisions as a file. Returns a cache key to track the export status.
Request Parameters
Parameter
Description
fields
Specifies the fields to be included in the export file. Available fields: name, division_type, erp_code, is_active, country_id, city_id, township_id, district_id, address, phone_number, fax_number, latitude, longitude, monthly_order_limit, current_balance, current_balance_last_update, extra_data
format
Specifies the file format for the export. Acceptable values are csv and xls. The default is xls.
status_cache_key
A query parameter to track the status of the file export using the cache key returned from the initial request.
Checks the status of an export file using the cache key obtained from the export request. Provides information on whether the file is ready for download.