Blacklist Services

Products that are identified as problematic or non-packable are added to a blacklist. Once blacklisted, these products are automatically excluded from the packing process for any future orders.

GET BlackList List

This function retrieves a list of products that have been blacklisted.

Path: /api/v1/oms/products/blacklist/

Example Request

To get list of blacklists, a GET request should be sent to /api/v1/oms/products/blacklist/ endpoint.

import requests

url = "https://{oms_base_url}/api/v1/oms/products/blacklist/"
api_token = "f532eXXXXXXXXXXXXXXXXX201XXXXX9332d"

headers = {
'Accept': 'application/json',
'Authorization': 'Token {}'.format(api_token)
}

response = requests.request("GET", url, headers=headers)

print(response.json())

Example Response (200 OK)

In a successful response with a status code of 200 OK, the API returns a list of blacklist information.

Parameter
Data Type
Description

id

integer

Unique identifier for each blacklist record. Serves as the primary key in the blacklist table.

product

integer

The unique identifier (ID) of the product that has been blacklisted. This product will be excluded from the packaging process in future order fulfillment operations.

stock_location

integer

The ID of the specific stock location where the product is considered problematic or non-packable. Blacklisting is location-specific, meaning the same product may be available in other locations.

package_item

integer

The ID of the package item that triggered the blacklisting due to a failed or problematic packaging attempt. Used for traceability and audit purposes.

This example response serves as a reference to understand the structure and data format of blacklist list:

{
    "count": 2,
    "next": null,
    "previous": null,
    "results": [
        {
            "id": 2,
            "product": 2,
            "stock_location": 2,
            "package_item": 3
        },
        {
            "id": 1,
            "product": 1,
            "stock_location": 1,
            "package_item": 1
        }
    ]
}

GET BlackList Detail

This method retrieves detailed information about a specific blacklist record.

Path: /api/v1/oms/products/blacklist/{id}/

Example Request

To get details of the blacklist, a GET request should be sent to /api/v1/oms/products/blacklist/{id} endpoint.


import requests

url = "https://{oms_base_url}/api/v1/oms/products/blacklist/1/"
api_token = "f532eXXXXXXXXXXXXXXXXX201XXXXX9332d"

headers = {
'Accept': 'application/json',
'Authorization': 'Token {}'.format(api_token)
}

response = requests.request("GET", url, headers=headers)

print(response.json())

Example Response (200 OK)

In a successful response with a status code of 200 OK, the API returns details of the blacklist record.

Parameter
Data Type
Description

id

integer

Unique identifier for each blacklist record. Serves as the primary key in the blacklist table.

product

integer

The unique identifier (ID) of the product that has been blacklisted. This product will be excluded from the packaging process in future order fulfillment operations.

stock_location

integer

The ID of the specific stock location where the product is considered problematic or non-packable. Blacklisting is location-specific, meaning the same product may be available in other locations.

package_item

integer

The ID of the package item that triggered the blacklisting due to a failed or problematic packaging attempt. Used for traceability and audit purposes.

This example response serves as a reference to understand the structure and data format of blacklist record detail.

{
    "id": 1,
    "product": 1,
    "stock_location": 1,
    "package_item": 1
}

POST Create Blacklist

This method is used to create a new blacklist record for a product that has been identified as problematic or non-packable during the packaging process.

Path: /api/v1/oms/products/blacklist/

Body Parameters

Parameter
Data Type
Required
Description

product

integer

Yes

The unique ID of the product to be blacklisted. This product will be excluded from future packaging operations at the specified stock location.

package_item

integer

Yes

The ID of the package item that triggered the blacklist action, typically due to a packaging error or failure. Used for traceability and logging purposes.

stock_location

integer

Yes

The ID of the stock location where the product was found to be problematic or non-packable. The blacklist is scoped to this specific location.

Example Request

To create a blacklist, a POST request should be sent to /api/v1/oms/products/blacklist/ endpoint.


import requests

payload = {
  "product": 1,
  "stock_location": 1,
  "package_item": 1
}

url = "https://{oms_base_url}/api/v1/oms/products/blacklist/"
api_token = "f532eXXXXXXXXXXXXXXXXX201XXXXX9332d"

headers = {
'Accept': 'application/json',
'Authorization': 'Token {}'.format(api_token)
}

response = requests.request("POST", url, headers=headers, json=payload)

print(response.json())

Example Response (201 Created)

In a successful response with a status code of 201 Created, the API returns details of blacklist record.

Parameter
Data Type
Description

id

integer

Unique identifier for each blacklist record. Serves as the primary key in the blacklist table.

product

integer

The unique identifier (ID) of the product that has been blacklisted. This product will be excluded from the packaging process in future order fulfillment operations.

stock_location

integer

The ID of the specific stock location where the product is considered problematic or non-packable. Blacklisting is location-specific, meaning the same product may be available in other locations.

package_item

integer

The ID of the package item that triggered the blacklisting due to a failed or problematic packaging attempt. Used for traceability and audit purposes.

This example response serves as a reference to understand the structure and data format of blacklist record detail.

{
    "id": 1,
    "product": 1,
    "stock_location": 1,
    "package_item": 1
}

PATCH Update Blacklist

This method is used to update an existing blacklist record.

Path: /api/v1/oms/products/blacklist/{id}

Example Request

To update blacklist, a PATCH request should be sent to /api/v1/oms/products/blacklist/{id}/ endpoint.

import requests

payload = {
 "product": 1,
 "stock_location": 1,
 "package_item": 1
}

url = "https://{oms_base_url}/api/v1/oms/products/blacklist/1/"
api_token = "f532eXXXXXXXXXXXXXXXXX201XXXXX9332d"

headers = {
'Accept': 'application/json',
'Authorization': 'Token {}'.format(api_token)
}

response = requests.request("PATCH", url, headers=headers, json=payload)

print(response.json())

Example Response (200 OK)

In a successful response with a status code of 200 OK, the API returns an updated blacklist record.

Parameter
Data Type
Description

id

integer

Unique identifier for each blacklist record. Serves as the primary key in the blacklist table.

product

integer

The unique identifier (ID) of the product that has been blacklisted. This product will be excluded from the packaging process in future order fulfillment operations.

stock_location

integer

The ID of the specific stock location where the product is considered problematic or non-packable. Blacklisting is location-specific, meaning the same product may be available in other locations.

package_item

integer

The ID of the package item that triggered the blacklisting due to a failed or problematic packaging attempt. Used for traceability and audit purposes.

This example response serves as a reference to understand the structure and data format of blacklist record detail.

{
            "id": 1,
            "product": 1,
            "stock_location": 1,
            "package_item": 1
}

DELETE Delete Blacklist

This method is used to delete a blacklist.

Path: /api/v1/oms/products/blacklist/{id}/

Example Request

To delete the blacklist, a DELETE request should be sent to /api/v1/oms/products/blacklist/{id} endpoint.


import requests

url = "https://{oms_base_url}/api/v1/oms/products/blacklist/1/"
api_token = "f532eXXXXXXXXXXXXXXXXX201XXXXX9332d"

headers = {
'Accept': 'application/json',
'Authorization': 'Token {}'.format(api_token)
}

response = requests.request("DELETE", url, headers=headers)

print(response.json())

Example Response (204 No Content)

In a successful response with a status code of 204 No Content, the API returns with an empty body.

Last updated

Was this helpful?