Skip to main content

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​

  1. Access Control: Access to supplier settings requires appropriate permissions
  2. Data Validation: All configurations must follow platform standards
  3. Usage Context: Some settings may be specific to stores or suppliers
  4. Response Handling: Proper error handling for missing or invalid configurations

Supplier Operations​

Get Cancellation Codes​

GET/supplier/cancelcodes

Retrieves the list of allowed cancellation codes configured for the supplier. These codes are used when canceling orders in the platform.

Response Parameters​

ParameterTypeDescription
reasonstringDescription of the cancellation reason
codestringUnique identifier for the cancellation code
usagestringIndicates who can use the code (STORE/SUPPLIER)

Response Example​

[
{
"reason": "I will place a new order",
"code": "NEW_ORDER",
"usage": "STORE"
}
]

Example Usage​

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));

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
Tana

Tana

Ask me anything about Nilo's API — endpoints, authentication, integration guides, or code examples.

Best practice: validate against the official documentation for the most up-to-date details.