Company Discount

This section is the extension of Discount section, it give's control over the company discounts.
To be active discount it must be attached to specific company (group) -
and then it will get applied at checkout.

Admin logged in -can attach any discount to any company, or remove any discount attachment from any company.
User logged in - can see any discount attached to his company (in case he is registered to a company) and in case there is discount attachment for his company.

update-company-discount

Update exact row from company_discounts DB table using company_discount_id

SecurityAuthorization
Request
path Parameters
company_name
required
string

company_name path parameter

Example: <company_discount_id:>
header Parameters
Authorization
required
string

auth header for JWT

Example: <JWT token>
username
required
string

auth header for username

Example: <username>
Request Body schema: application/json
required

raw(json)

company
string
discount_id
string
expiry_date
string
Responses
200

Success

401

Unauthorized

403

Forbidden

put/discounts/company/{company_name}
Request samples
application/json
{
  • "company": "Crymbo",
  • "discount_id": "WlBPdmtSY2hITGM9",
  • "expiry_date": "2023-07-26 08:53:53"
}
Response samples
application/json
{
  • "api_message": "<string>",
  • "api_data": {
    }
}

get-company-discount-list

Getting discounts list attached to company

SecurityAuthorization
Request
path Parameters
company_name
required
string

company_name path parameter

Example: <company_name>
header Parameters
Authorization
required
string

auth header for JWT

Example: <JWT token>
username
required
string

auth header for username

Example: <username>
Responses
200

Success

401

Unauthorized

403

Forbidden

get/discounts/company/{company_name}
Response samples
application/json
{
  • "api_message": "<string>",
  • "api_data": [
    ]
}

delete-comapny-discount

Delete exact row from company_discounts DB table using company_discount_id

SecurityAuthorization
Request
path Parameters
company_name
required
string

company_name path parameter

Example: <company_discount_id>
header Parameters
Authorization
required
string

auth header for JWT

Example: <JWT token>
username
required
string

auth header for username

Example: <username>
Responses
204

No Content (Success)

401

Unauthorized

403

Forbidden

delete/discounts/company/{company_name}
Response samples
application/json
{ }

attach-discount-to-company

Attach a discount to a specified company.

SecurityAuthorization
Request
header Parameters
Authorization
required
string

auth header for JWT

Example: <JWT token>
username
required
string

auth header for username

Example: <username>
Request Body schema: application/json
required

raw(json)

company
string
discount_id
string
expiry_date
string
Responses
200

Success

401

Unauthorized

403

Forbidden

422

Unprocessable Content

500

Internal Server Error

post/discounts/company
Request samples
application/json
{
  • "company": "Crymbo",
  • "discount_id": "WlBPdmtSY2hITGM9",
  • "expiry_date": "2023-07-26 08:53:53"
}
Response samples
application/json
{
  • "api_message": "<string>",
  • "api_data": {
    }
}