Supplier API
The Supplier API allows you to manage supplier-specific configurations and settings in the Nilo platform. These endpoints help you retrieve and manage supplier-related information, such as cancellation codes for orders.
Understanding Supplier Settings
Supplier settings in Nilo represent configuration options and business rules specific to each supplier:
- Configuration Types
- Cancellation codes and reasons
- Usage permissions (Store/Supplier)
- Business rules and preferences
Important Considerations
- Access Control: Access to supplier settings requires appropriate permissions
- Data Validation: All configurations must follow platform standards
- Usage Context: Some settings may be specific to stores or suppliers
- Response Handling: Proper error handling for missing or invalid configurations
Supplier Operations
Get Cancellation Codes
GET
/supplier/cancelcodesRetrieves the list of allowed cancellation codes configured for the supplier. These codes are used when canceling orders in the platform.
Response Parameters
| Parameter | Type | Description |
|---|---|---|
| reason | string | Description of the cancellation reason |
| code | string | Unique identifier for the cancellation code |
| usage | string | Indicates who can use the code (STORE/SUPPLIER) |
Response Example
[
{
"reason": "I will place a new order",
"code": "NEW_ORDER",
"usage": "STORE"
}
]
Example Usage
- Javascript
- Python
const headers = {
Authorization: "YOUR_AUTH_TOKEN",
"x-api-key": "YOUR_API_KEY",
};
fetch("https://api.nilo.com/supplier/cancelcodes", {
method: "GET",
headers: headers,
})
.then((response) => response.json())
.then((result) => console.log(result))
.catch((error) => console.log("error", error));
import requests
url = "https://api.nilo.com/supplier/cancelcodes"
headers = {
'Authorization': 'YOUR_AUTH_TOKEN',
'x-api-key': 'YOUR_API_KEY'
}
response = requests.get(url, headers=headers)
print(response.text)
Security
Authentication
All endpoints require two types of authentication:
- API Key in header:
x-api-key - Authorization token in header:
Authorization
Required Permissions
For supplier endpoints, the following permissions are required:
- For reading cancellation codes:
supplier/code.read